New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strings: Document use of simple case-folding in EqualFold #52022
Comments
I'd be happy to submit a CL to fix this. |
Change https://go.dev/cl/396616 mentions this issue: |
I think the same modification can be done to bytes.EqualFold |
(I haven't set up a Gerrit account, so commenting here on the patch:) I just realized that in terms of wording, it may make sense to consistently use the same variables:
|
Resolved |
@typesanitizer |
Change https://go.dev/cl/398736 mentions this issue: |
…alFold This CL removes the problem description pointed out by @bjkail. Second, synchronously modify the comments of the bytes package. Updates #52022 Fixes #52204 Change-Id: I0aa52c774f40bb91f32bebdd2a62a11067a77be0 Reviewed-on: https://go-review.googlesource.com/c/go/+/398736 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Auto-Submit: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Trust: Cherry Mui <cherryyz@google.com>
At the moment, the documentation for
EqualFold
says:However, this is under-specified.
EqualFold
uses simple case-folding, not full case-folding, which can be surprising. For example, Python 3 and Swift default to full case folding:I think it would be better to explicitly state that simple case-folding is being used. Perhaps something like:
Perhaps it would be also helpful to have an example like:
One can also add a fuzz test if so desired:
The text was updated successfully, but these errors were encountered: