]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/modload: eliminate LoadedModules
authorBryan C. Mills <bcmills@google.com>
Thu, 19 Nov 2020 18:58:52 +0000 (13:58 -0500)
committerBryan C. Mills <bcmills@google.com>
Fri, 20 Nov 2020 15:19:17 +0000 (15:19 +0000)
As of CL 271646, all external callers have been eliminated. Replace
the remaining internal caller with a direct reference to the buildList
variable and remove the exported function to prevent backsliding.

For #36460

Change-Id: Iea82df1e3e604ada602dda3e830c06d441eee2a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/271647
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/modload/build.go
src/cmd/go/internal/modload/buildlist.go

index b9e344045d2ba104476c3bb9a24b93a4a81ff0c7..8ad5f834def7ef154ffdc57696effad8fb6a7753 100644 (file)
@@ -75,7 +75,7 @@ func ModuleInfo(ctx context.Context, path string) *modinfo.ModulePublic {
                return moduleInfo(ctx, m, fromBuildList, listRetracted)
        }
 
-       for _, m := range LoadedModules() {
+       for _, m := range buildList {
                if m.Path == path {
                        fromBuildList := true
                        return moduleInfo(ctx, m, fromBuildList, listRetracted)
index 5b9984a49248ce4667bef4a4c2119821e943fa67..bec22dba1f6207a8cf769e78f8742e545037f73d 100644 (file)
@@ -49,15 +49,6 @@ func LoadAllModules(ctx context.Context) []module.Version {
        return capVersionSlice(buildList)
 }
 
-// LoadedModules returns the list of module requirements loaded or set by a
-// previous call (typically LoadAllModules or LoadPackages), starting with the
-// Target module and in a deterministic (stable) order.
-//
-// The caller must not modify the returned list, but may append to it.
-func LoadedModules() []module.Version {
-       return capVersionSlice(buildList)
-}
-
 // Selected returns the selected version of the module with the given path, or
 // the empty string if the given module has no selected version
 // (either because it is not required or because it is the Target module).