]> Cypherpunks repositories - gostls13.git/commit
cmd/go: improve 'go mod download' and 'go list -m' error messages
authorJay Conrod <jayconrod@google.com>
Wed, 7 Aug 2019 20:27:39 +0000 (16:27 -0400)
committerJay Conrod <jayconrod@google.com>
Thu, 8 Aug 2019 20:38:47 +0000 (20:38 +0000)
commit1dc0110bf725640a9b912e3d31e6654ed1c4da9d
tree96a093b582c17b9e7e39d2d10716a81753ad0c27
parentc5178ef69eedce1374e684212ea9cdae6220e0f6
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>
src/cmd/go/internal/list/list.go
src/cmd/go/internal/modcmd/download.go
src/cmd/go/internal/modload/list.go
src/cmd/go/testdata/script/mod_download.txt
src/cmd/go/testdata/script/mod_list.txt
src/cmd/go/testdata/script/mod_query.txt