aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modload/buildlist.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2020-11-17 23:16:30 -0500
committerBryan C. Mills <bcmills@google.com>2020-11-19 04:02:59 +0000
commit5ba1c3f290ef8f3c373c560d3608325b07f44f7a (patch)
tree7af8cfc5e997446c20a539b22077ab53cc57120a /src/cmd/go/internal/modload/buildlist.go
parentff2824d4b3391c644b264273f98a47302e2d4ab6 (diff)
downloadgo-5ba1c3f290ef8f3c373c560d3608325b07f44f7a.tar.gz
go-5ba1c3f290ef8f3c373c560d3608325b07f44f7a.zip
cmd/go/internal/modload: remove SetBuildList
For the last remaining call site (in cmd/go/internal/work, added for the new 'go install pkg@version' codepath in CL 254365), use EditBuildList instead. SetBuildList assumes that the caller has enough information to produce a complete, coherent build list. With lazy loading, producing a complete, coherent build list is no longer quite so trivial. In CL 263267, I rewrote the main caller of SetBuildList (the 'go get' command), and in the process added a more targeted modload hook (EditBuildList). That hook also suffices for 'go install pkg@version'. The resulting error messages are perhaps not as smooth as they ought to be, but if they are too awkward we should probably fix them for 'go get' too, and the commands can continue to share the edit hook. For #36460 Updates #40276 Change-Id: I698a9dcd2efe6378a4d91f21362880aa8e50001b Reviewed-on: https://go-review.googlesource.com/c/go/+/270980 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/buildlist.go')
-rw-r--r--src/cmd/go/internal/modload/buildlist.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/cmd/go/internal/modload/buildlist.go b/src/cmd/go/internal/modload/buildlist.go
index 4aaaa8d206..5b9984a492 100644
--- a/src/cmd/go/internal/modload/buildlist.go
+++ b/src/cmd/go/internal/modload/buildlist.go
@@ -73,13 +73,6 @@ func Selected(path string) (version string) {
return ""
}
-// SetBuildList sets the module build list.
-// The caller is responsible for ensuring that the list is valid.
-// SetBuildList does not retain a reference to the original list.
-func SetBuildList(list []module.Version) {
- buildList = append([]module.Version{}, list...)
-}
-
// EditBuildList edits the global build list by first adding every module in add
// to the existing build list, then adjusting versions (and adding or removing
// requirements as needed) until every module in mustSelect is selected at the
@@ -222,7 +215,7 @@ type Conflict struct {
}
// ReloadBuildList resets the state of loaded packages, then loads and returns
-// the build list set in SetBuildList.
+// the build list set by EditBuildList.
func ReloadBuildList() []module.Version {
loaded = loadFromRoots(loaderParams{
PackageOpts: PackageOpts{