Skip to content

Commit

Permalink
starlark: work around vet false positive (#277)
Browse files Browse the repository at this point in the history
The stringintconv checker added in
https://go-review.googlesource.com/c/tools/+/235797
requires an explicit rune type for the operand of a string(int) conversion.
  • Loading branch information
adonovan authored Jun 11, 2020
1 parent cd131d1 commit 3353e41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion starlark/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func chr(thread *Thread, _ *Builtin, args Tuple, kwargs []Tuple) (Value, error)
if i > unicode.MaxRune {
return nil, fmt.Errorf("chr: Unicode code point U+%X out of range (>0x10FFFF)", i)
}
return String(string(i)), nil
return String(string(rune(i))), nil
}

// https://github.com/google/starlark-go/blob/master/doc/spec.md#dict
Expand Down

0 comments on commit 3353e41

Please sign in to comment.