]> Cypherpunks repositories - gostls13.git/commit
cmd/go: inject State parameter into `modcmd.runInit`
authorIan Alexander <jitsu@google.com>
Thu, 2 Oct 2025 03:04:06 +0000 (23:04 -0400)
committerIan Alexander <jitsu@google.com>
Mon, 20 Oct 2025 19:57:12 +0000 (12:57 -0700)
commit92aa3e9e98430ae48e3341b01434b5095f3b1c9e
tree43b08ec5a82a9565ab8db20a9a88d0e8032cf0a5
parente176dff41c42208d977e3c7adda4484febb73ec0
cmd/go: inject State parameter into `modcmd.runInit`

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

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