]> Cypherpunks repositories - gostls13.git/commit
cmd/go: reduce redundancy in direct mode lookup error messages
authorJay Conrod <jayconrod@google.com>
Fri, 6 Dec 2019 18:10:53 +0000 (13:10 -0500)
committerJay Conrod <jayconrod@google.com>
Fri, 6 Dec 2019 19:49:21 +0000 (19:49 +0000)
commitb2a5893f44ee4426caffc33bbca907a05efe6b57
tree582dab193d0fc729e4323a30e26590d6e9258dcb
parenta6c8fac78194bf84eb75c845f2a80646211877c5
cmd/go: reduce redundancy in direct mode lookup error messages

get.RepoRootForImportPath now returns errors that satisfy
load.ImportPathError in cases where the import path appears in the
messages. (The import path probably should appear in all errors from
this function, but this CL does not change these errors).

Changed modfetch.notExistError to be a wrapper (with an Unwrap method)
instead of a string. This means errors.As works with notFoundError and
ImportPathError.

ImportMissingError no longer prints the package path if it wraps an
ImportPathError.

TestMissingImportErrorRepetition no longer counts the package path
within a URL (like https://...?go-get=1).

Fixes #35986

Change-Id: I38f795191c46d04b542c553e705f23822260c790
Reviewed-on: https://go-review.googlesource.com/c/go/+/210338
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/get/vcs.go
src/cmd/go/internal/modfetch/coderepo.go
src/cmd/go/internal/modfetch/repo.go
src/cmd/go/internal/modload/import.go
src/go/build/build_test.go