diff options
author | smasher164 <aindurti@gmail.com> | 2020-05-06 22:30:17 -0400 |
---|---|---|
committer | Rebecca Stambler <rstambler@golang.org> | 2020-05-07 05:02:07 +0000 |
commit | a1532b81a28fb0525ba7538ce6ee4878d37601cb (patch) | |
tree | f597e44b13ecea3aa7fa884399d23179db70252b /internal/lsp/cache/parse.go | |
parent | be0c89d0d3ecf9286f68f749518fbe751785531e (diff) | |
download | golang-x-tools-a1532b81a28fb0525ba7538ce6ee4878d37601cb.tar.gz |
internal/lsp/cache: avoid string(int) conversion
LoadMode and ParseMode are currently hashed with a string(int)
conversion, but this conversion is now discouraged (see the vet check
'stringintconv' for more information). Since the hash uses the code
point, this change replaces these instances with string(rune(int)).
Updates golang/go#32479.
Change-Id: I0d8e91d073fc34ac9faafe75a0d86cf71a5327d4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/232679
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'internal/lsp/cache/parse.go')
-rw-r--r-- | internal/lsp/cache/parse.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/lsp/cache/parse.go b/internal/lsp/cache/parse.go index 0bfb7f6f8..81ef3c7bc 100644 --- a/internal/lsp/cache/parse.go +++ b/internal/lsp/cache/parse.go @@ -111,7 +111,7 @@ func (pgh *parseGoHandle) Cached() (*ast.File, []byte, *protocol.ColumnMapper, e func hashParseKey(ph source.ParseGoHandle) string { b := bytes.NewBuffer(nil) b.WriteString(ph.File().Identity().String()) - b.WriteString(string(ph.Mode())) + b.WriteString(string(rune(ph.Mode()))) return hashContents(b.Bytes()) } |