Skip to content

Commit

Permalink
fix: go vet 1.15 warnings (robertkrimen#385)
Browse files Browse the repository at this point in the history
Convert int to string using rune()

See golang/go#32479

Fix robertkrimen#384.

Signed-off-by: Robert-André Mauchin <[email protected]>
  • Loading branch information
eclipseo authored Sep 27, 2021
1 parent 373ff54 commit dee429e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ var parseInt_alphabetTable = func() []string {
for radix := 3; radix <= 36; radix += 1 {
alphabet := table[radix-1]
if radix <= 10 {
alphabet += string(radix + 47)
alphabet += string(rune(radix + 47))
} else {
alphabet += string(radix+54) + string(radix+86)
alphabet += string(rune(radix+54)) + string(rune(radix+86))
}
table = append(table, alphabet)
}
Expand Down
2 changes: 1 addition & 1 deletion regexp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func TestRegExp_controlCharacter(t *testing.T) {
test, _ := test()

for code := 0x41; code < 0x5a; code++ {
string_ := string(code - 64)
string_ := string(rune(code - 64))
test(fmt.Sprintf(`
var code = 0x%x;
var string = String.fromCharCode(code %% 32);
Expand Down

0 comments on commit dee429e

Please sign in to comment.