Skip to content

Commit 5d2377a

Browse files
author
Bryan C. Mills
committed
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 <[email protected]> Reviewed-by: Jay Conrod <[email protected]>
1 parent eb2fabf commit 5d2377a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/cmd/go/internal/modload/list.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,15 @@ func listModules(args []string, listVersions bool) []*modinfo.ModulePublic {
104104
info, err := Query(arg, "latest", nil)
105105
if err == nil {
106106
mods = append(mods, moduleInfo(module.Version{Path: arg, Version: info.Version}, false))
107-
continue
107+
} else {
108+
mods = append(mods, &modinfo.ModulePublic{
109+
Path: arg,
110+
Error: &modinfo.ModuleError{
111+
Err: err.Error(),
112+
},
113+
})
108114
}
115+
continue
109116
}
110117
mods = append(mods, &modinfo.ModulePublic{
111118
Path: arg,

0 commit comments

Comments
 (0)