mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
all: avoid string(i) where i has type int
Instead use string(r) where r has type rune. This is in preparation for a vet warning for string(i). Updates #32479 Change-Id: Ic205269bba1bd41723950219ecfb67ce17a7aa79 Reviewed-on: https://go-review.googlesource.com/c/go/+/220844 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Akhil Indurti <aindurti@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Toshihiro Shiino <shiino.toshihiro@gmail.com>
This commit is contained in:
parent
c46ffdd2ec
commit
6052838bc3
12 changed files with 56 additions and 56 deletions
|
|
@ -678,8 +678,8 @@ func TestMap(t *testing.T) {
|
|||
}
|
||||
return r
|
||||
}
|
||||
s := string(utf8.RuneSelf) + string(utf8.MaxRune)
|
||||
r := string(utf8.MaxRune) + string(utf8.RuneSelf) // reverse of s
|
||||
s := string(rune(utf8.RuneSelf)) + string(utf8.MaxRune)
|
||||
r := string(utf8.MaxRune) + string(rune(utf8.RuneSelf)) // reverse of s
|
||||
m = Map(encode, s)
|
||||
if m != r {
|
||||
t.Errorf("encoding not handled correctly: expected %q got %q", r, m)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue