maps: use strings.EqualFold in example

Change-Id: I40a9684a9465e844ff1de46601edf23de7b637e3
GitHub-Last-Rev: 15ef023853
GitHub-Pull-Request: golang/go#65541
Reviewed-on: https://go-review.googlesource.com/c/go/+/561855
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
guoguangwu 2024-02-20 06:13:08 +00:00 committed by Gopher Robot
parent 113eb42efc
commit eec40aae45

View file

@ -128,7 +128,7 @@ func ExampleEqualFunc() {
1000: []byte("Thousand"),
}
eq := maps.EqualFunc(m1, m2, func(v1 string, v2 []byte) bool {
return strings.ToLower(v1) == strings.ToLower(string(v2))
return strings.EqualFold(v1, string(v2))
})
fmt.Println(eq)
// Output: