aboutsummaryrefslogtreecommitdiff
path: root/go/packages/golist.go
diff options
context:
space:
mode:
authorRebecca Stambler <rstambler@golang.org>2020-04-02 17:27:48 -0400
committerRebecca Stambler <rstambler@golang.org>2020-04-03 19:08:13 +0000
commit44a64ad78b9b521790ab78240c17a3bc75b5eaa7 (patch)
tree1adfa0be1d2f34d18b83e4254f85d1c0784ffa00 /go/packages/golist.go
parent4480df5f16277fac3c49dbd103521626b10718a5 (diff)
downloadgolang-x-tools-44a64ad78b9b521790ab78240c17a3bc75b5eaa7.tar.gz
internal/lsp, go/packages: don't log context cancellation errors
Instead of checking the context, check the error. This may expose some errors that are not wrapped correctly. Replaced all uses of errors with golang.org/x/xerrors. Change-Id: Ia40160f8ea352e02618765f2a9415a4ece0dcd94 Reviewed-on: https://go-review.googlesource.com/c/tools/+/227036 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'go/packages/golist.go')
-rw-r--r--go/packages/golist.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/go/packages/golist.go b/go/packages/golist.go
index f37824266..099207d78 100644
--- a/go/packages/golist.go
+++ b/go/packages/golist.go
@@ -25,6 +25,7 @@ import (
"golang.org/x/tools/go/internal/packagesdriver"
"golang.org/x/tools/internal/gocommand"
"golang.org/x/tools/internal/packagesinternal"
+ "golang.org/x/xerrors"
)
// debug controls verbose logging.
@@ -736,7 +737,7 @@ func (state *golistState) invokeGo(verb string, args ...string) (*bytes.Buffer,
if !ok {
// Catastrophic error:
// - context cancellation
- return nil, fmt.Errorf("couldn't run 'go': %v", err)
+ return nil, xerrors.Errorf("couldn't run 'go': %w", err)
}
// Old go version?