diff options
author | Rohan Challa <rohan@golang.org> | 2020-03-23 08:35:36 -0400 |
---|---|---|
committer | Rebecca Stambler <rstambler@golang.org> | 2020-04-08 03:22:09 +0000 |
commit | 46bd65c8538fb57593a8365bea5663a3239aee37 (patch) | |
tree | 0d5909033cc53f34ced1615b0d22002193bbe4d6 /internal/lsp/debug | |
parent | 4d14fc9c00cedea0631fe7d87ee41b1a25031402 (diff) | |
download | golang-x-tools-46bd65c8538fb57593a8365bea5663a3239aee37.tar.gz |
internal/lsp/cache: add concurrency error check for go cmds
This change attempts to fix a concurrency error that would cause
textDocument/CodeLens, textDocument/Formatting, textDocument/DocumentLink,
and textDocument/Hover from failing on go.mod files.
The issue was that the go command would return a potential concurrency
error since the ModHandle and the ModTidyHandle are both using the
temporary go.mod file.
Updates golang/go#37824
Change-Id: I6cd63c1f75817c7308e033aec473966536a2a3bd
Reviewed-on: https://go-review.googlesource.com/c/tools/+/224917
Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'internal/lsp/debug')
-rw-r--r-- | internal/lsp/debug/info.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/lsp/debug/info.go b/internal/lsp/debug/info.go index 8baf1d932..b070c99f1 100644 --- a/internal/lsp/debug/info.go +++ b/internal/lsp/debug/info.go @@ -50,10 +50,10 @@ func PrintVersionInfo(ctx context.Context, w io.Writer, verbose bool, mode Print }) fmt.Fprint(w, "\n") section(w, mode, "Go info", func() { - i := &gocommand.Invocation{ + gocmdRunner := &gocommand.Runner{} + version, err := gocmdRunner.Run(ctx, gocommand.Invocation{ Verb: "version", - } - version, err := i.Run(ctx) + }) if err != nil { panic(err) } |