]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/modload: propagate errors from Query in 'list -versions'
authorBryan C. Mills <bcmills@google.com>
Thu, 6 Jun 2019 18:30:56 +0000 (14:30 -0400)
committerBryan C. Mills <bcmills@google.com>
Fri, 7 Jun 2019 16:18:44 +0000 (16:18 +0000)
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>
src/cmd/go/internal/modload/list.go

index 2f1a3c24d223cf007299bf5a049b139e9ba97b04..5d5c3288b8f61ed07fc450ee4f826a5c2eac59c5 100644 (file)
@@ -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,