diff options
author | Bryan C. Mills <bcmills@google.com> | 2020-11-20 17:03:42 -0500 |
---|---|---|
committer | Bryan C. Mills <bcmills@google.com> | 2020-11-21 03:29:37 +0000 |
commit | f93ef07b1143abf3003555c4afcadc0e9842cbf8 (patch) | |
tree | aad0ee4f51ff9da490d504d6fc2f43ae582d72a7 /src/cmd/go/internal/modload/load.go | |
parent | 3f5a97514b16c432d9699a0f1a913fabd3c0cb86 (diff) | |
download | go-f93ef07b1143abf3003555c4afcadc0e9842cbf8.tar.gz go-f93ef07b1143abf3003555c4afcadc0e9842cbf8.zip |
cmd/go/internal/modload: remove the Reqs function
The Reqs function returns an mvs.Reqs implemention for the global
build list. The API that it presents assumes that the build list is
globally consistent (problematic for #40775) and readily available
(problematic for #36460).
Fortunately, it is no longer used outside of the modload package.
We can instead use individual instances of the unexported mvsReqs
struct, making the dependency on the global build list more explicit.
For #36460
For #40775
Change-Id: I8674442f2a86416b0bf9c3395cb591c1e724c9d2
Reviewed-on: https://go-review.googlesource.com/c/go/+/272129
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/internal/modload/load.go')
-rw-r--r-- | src/cmd/go/internal/modload/load.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/go/internal/modload/load.go b/src/cmd/go/internal/modload/load.go index 302330278e..732c4af92b 100644 --- a/src/cmd/go/internal/modload/load.go +++ b/src/cmd/go/internal/modload/load.go @@ -800,7 +800,7 @@ func loadFromRoots(params loaderParams) *loader { } var err error - reqs := Reqs() + reqs := &mvsReqs{buildList: buildList} buildList, err = mvs.BuildList(Target, reqs) if err != nil { base.Fatalf("go: %v", err) @@ -842,7 +842,7 @@ func loadFromRoots(params loaderParams) *loader { } // Recompute buildList with all our additions. - reqs = Reqs() + reqs = &mvsReqs{buildList: buildList} buildList, err = mvs.BuildList(Target, reqs) if err != nil { // If an error was found in a newly added module, report the package |