]> Cypherpunks repositories - gostls13.git/commit
cmd/go: inject State parameter into `modget.runGet`
authorIan Alexander <jitsu@google.com>
Wed, 1 Oct 2025 21:45:25 +0000 (17:45 -0400)
committerIan Alexander <jitsu@google.com>
Mon, 20 Oct 2025 19:59:47 +0000 (12:59 -0700)
commit9769a61e6420a05685142fabfb0932abd1375e14
tree9b0865d2826c924a45055c63f1a374cfb9871038
parentf859799ccf537bc5f506698ae2d1ce028b81c78c
cmd/go: inject State parameter into `modget.runGet`

This command modifies the call tree starting at `modget.runGet` to
inject a `State` parameter to every function that is currently using
the global `modload.LoaderState` variable.  By explicilty passing a
`State` parameter, we can begin to eliminate the usage of the global
`modload.LoaderState`.

This commit is part of the overall effort to eliminate global
modloader state.

[git-generate]
cd src/cmd/go/internal/modget
rf 'inject modload.LoaderState runGet'
cd ..
./rf-cleanup.zsh

Change-Id: Icafc5cff07c49809f5c199feec9ed7795536976c
Reviewed-on: https://go-review.googlesource.com/c/go/+/709981
Reviewed-by: Michael Matloob <matloob@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/modget/query.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/modload/search.go