]> Cypherpunks repositories - gostls13.git/commit
cmd/go: inject State parameter into `modcmd.runVendor`
authorIan Alexander <jitsu@google.com>
Thu, 2 Oct 2025 03:18:10 +0000 (23:18 -0400)
committerIan Alexander <jitsu@google.com>
Mon, 20 Oct 2025 19:59:10 +0000 (12:59 -0700)
commit0f820aca291dfd091c87c045147715cc1bf7266b
tree4f4d1dfe98d30a31abb65898af0e6397bb292d60
parent92aa3e9e98430ae48e3341b01434b5095f3b1c9e
cmd/go: inject State parameter into `modcmd.runVendor`

This command modifies the call tree starting at `modcmd.runVendor` 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/modcmd
rf 'inject modload.LoaderState runVendor'
cd ..
./rf-cleanup.zsh

Change-Id: I0572e165d291e34d212ded9a420871688b7915ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/709984
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/modcmd/vendor.go
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/workcmd/vendor.go