diff options
author | Jay Conrod <jayconrod@google.com> | 2019-08-07 16:27:39 -0400 |
---|---|---|
committer | Jay Conrod <jayconrod@google.com> | 2019-08-08 20:38:47 +0000 |
commit | 1dc0110bf725640a9b912e3d31e6654ed1c4da9d (patch) | |
tree | 96a093b582c17b9e7e39d2d10716a81753ad0c27 /src/cmd/go/internal/list/list.go | |
parent | c5178ef69eedce1374e684212ea9cdae6220e0f6 (diff) | |
download | go-1dc0110bf725640a9b912e3d31e6654ed1c4da9d.tar.gz go-1dc0110bf725640a9b912e3d31e6654ed1c4da9d.zip |
cmd/go: improve 'go mod download' and 'go list -m' error messages
modload.ListModules now wraps errors as module.ModuleError as
appropriate. The resulting errors always include the module path and
will include the version, if known.
'go mod download' no longer ignores errors reported by ListModules.
Previously, it started requesting module info, go.mod, and zip. Those
requests would fail, overwriting the original failure. They were
usually less descriptive.
'go mod download' with a module not in the build list (and no version
query) is now an error. Previously, this was silently ignored.
Fixes #30743
Change-Id: Icee8c1c6c5240de135a8b6ba42d6bbcdb757cdac
Reviewed-on: https://go-review.googlesource.com/c/go/+/189323
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/list/list.go')
-rw-r--r-- | src/cmd/go/internal/list/list.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/internal/list/list.go b/src/cmd/go/internal/list/list.go index 4a6633d9a1..a5f1abe64a 100644 --- a/src/cmd/go/internal/list/list.go +++ b/src/cmd/go/internal/list/list.go @@ -390,7 +390,7 @@ func runList(cmd *base.Command, args []string) { if !*listE { for _, m := range mods { if m.Error != nil { - base.Errorf("go list -m %s: %v", m.Path, m.Error.Err) + base.Errorf("go list -m: %v", m.Error.Err) } } base.ExitIfErrors() |