Commit 5d2377a6 authored by Bryan C. Mills's avatar Bryan C. Mills

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: default avatarJay Conrod <jayconrod@google.com>
parent eb2fabf2
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment