]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/go/internal/modload/search.go
cmd/go/internal/modload: omit return at the end of matchPackages
[gostls13.git] / src / cmd / go / internal / modload / search.go
index cb03b697a8ad626b796ef10aaa2a2b1ffe97c9d4..d392b5bf3dd9780ec02e2d0a8d96adff7e7254c5 100644 (file)
@@ -164,10 +164,13 @@ func matchPackages(ctx context.Context, m *search.Match, tags map[string]bool, f
        }
 
        if cfg.BuildMod == "vendor" {
-               mod := MainModules.mustGetSingleMainModule()
-               if modRoot := MainModules.ModRoot(mod); modRoot != "" {
-                       walkPkgs(modRoot, MainModules.PathPrefix(mod), pruneGoMod|pruneVendor)
-                       walkPkgs(filepath.Join(modRoot, "vendor"), "", pruneVendor)
+               for _, mod := range MainModules.Versions() {
+                       if modRoot := MainModules.ModRoot(mod); modRoot != "" {
+                               walkPkgs(modRoot, MainModules.PathPrefix(mod), pruneGoMod|pruneVendor)
+                       }
+               }
+               if HasModRoot() {
+                       walkPkgs(VendorDir(), "", pruneVendor)
                }
                return
        }
@@ -210,8 +213,6 @@ func matchPackages(ctx context.Context, m *search.Match, tags map[string]bool, f
                }
                walkPkgs(root, modPrefix, prune)
        }
-
-       return
 }
 
 // walkFromIndex matches packages in a module using the module index. modroot