mirror of
https://github.com/golang/go
synced 2024-11-17 02:14:42 -07:00
cmd/go/internal/modload: propagate errors from Query in 'list -versions'
Fixes #32335 Change-Id: I1cf8645ecc5ba0866d9b3589a18bb500ea17f865 Reviewed-on: https://go-review.googlesource.com/c/go/+/181018 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com>
This commit is contained in:
parent
eb2fabf2fa
commit
5d2377a607
@ -104,8 +104,15 @@ func listModules(args []string, listVersions bool) []*modinfo.ModulePublic {
|
||||
info, err := Query(arg, "latest", nil)
|
||||
if err == nil {
|
||||
mods = append(mods, moduleInfo(module.Version{Path: arg, Version: info.Version}, false))
|
||||
continue
|
||||
} else {
|
||||
mods = append(mods, &modinfo.ModulePublic{
|
||||
Path: arg,
|
||||
Error: &modinfo.ModuleError{
|
||||
Err: err.Error(),
|
||||
},
|
||||
})
|
||||
}
|
||||
continue
|
||||
}
|
||||
mods = append(mods, &modinfo.ModulePublic{
|
||||
Path: arg,
|
||||
|
Loading…
Reference in New Issue
Block a user