Closed
Description
What version of Go are you using (go version
)?
$ go version go version go1.17.5 linux/amd64
Does this issue reproduce with the latest release?
Yes
What did you do?
https://sourcegraph.com/search?q=context:global+switch+strings.Compare+lang:Go+&patternType=literal
What did you expect to see?
The strings.Compare
should do one comparison for all cases.
What did you see instead?
The strings.Compare
does two comparisons for some cases.
https://github.com/golang/go/blob/go1.17.5/src/strings/compare.go#L13