1
0
mirror of https://github.com/golang/go synced 2024-11-18 17:14:45 -07:00

cmd/go/internal/modfetch: report the module path for errors in (*codeRepo).Versions

Updates #34094

Change-Id: Ifd10b51c2b4ebe77c4f8f68726e411f54c13b9c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/194560
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
This commit is contained in:
Bryan C. Mills 2019-09-05 14:26:29 -04:00
parent 5bb19e3454
commit de4c0730cb

View File

@ -140,7 +140,10 @@ func (r *codeRepo) Versions(prefix string) ([]string, error) {
}
tags, err := r.code.Tags(p)
if err != nil {
return nil, err
return nil, &module.ModuleError{
Path: r.modPath,
Err: err,
}
}
list := []string{}
@ -171,7 +174,10 @@ func (r *codeRepo) Versions(prefix string) ([]string, error) {
// by referring to them with a +incompatible suffix, as in v17.0.0+incompatible.
files, err := r.code.ReadFileRevs(incompatible, "go.mod", codehost.MaxGoMod)
if err != nil {
return nil, err
return nil, &module.ModuleError{
Path: r.modPath,
Err: err,
}
}
for _, rev := range incompatible {
f := files[rev]