diff options
author | Jay Conrod <jayconrod@google.com> | 2019-12-06 13:10:53 -0500 |
---|---|---|
committer | Jay Conrod <jayconrod@google.com> | 2019-12-06 19:49:21 +0000 |
commit | b2a5893f44ee4426caffc33bbca907a05efe6b57 (patch) | |
tree | 582dab193d0fc729e4323a30e26590d6e9258dcb /src/cmd/go/internal/modfetch/coderepo.go | |
parent | a6c8fac78194bf84eb75c845f2a80646211877c5 (diff) | |
download | go-b2a5893f44ee4426caffc33bbca907a05efe6b57.tar.gz go-b2a5893f44ee4426caffc33bbca907a05efe6b57.zip |
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>
Diffstat (limited to 'src/cmd/go/internal/modfetch/coderepo.go')
-rw-r--r-- | src/cmd/go/internal/modfetch/coderepo.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/internal/modfetch/coderepo.go b/src/cmd/go/internal/modfetch/coderepo.go index 849e8c7ca1..de757ecd27 100644 --- a/src/cmd/go/internal/modfetch/coderepo.go +++ b/src/cmd/go/internal/modfetch/coderepo.go @@ -359,7 +359,7 @@ func (r *codeRepo) convert(info *codehost.RevInfo, statVers string) (*RevInfo, e Path: r.modPath, Err: &module.InvalidVersionError{ Version: info2.Version, - Err: notExistError(err.Error()), + Err: notExistError{err: err}, }, } } |