Proper place for a functhion?

Dear maintainers!

As you might have guessed from this PR (by the way, I think it’s ready, so if anyone finds a minute or two to review and tell me I’m heading in the wrong direction, this would be highly appreciated; I’m not saying it’s urgent or something, you are busy enough as it is for sure… but I digress) I’m trying to make first steps in the general direction of implementing case-insensitivity.

As became evident during work on this PR, simpe strings.ToLower() wouldn’t do for case-insensitive index, so I wrote a simple and somewhat slow (will do more thinking in this department) FoldString(s string) string that returns a case-folded string such that FoldString(s) == FoldString(t) always equals strings.EqualFold(s, t), and hence is suitable for index-forming. I would like to make a PR of these 12 lines of code (and corresponding tests, naturally), but I’m having a hard time deciding where in the project structure such a general-purpose func should fit. Any hints?

1 Like