]> Cypherpunks repositories - gostls13.git/commit
cmd/go: inject State parameter into `work.runBuild`
authorIan Alexander <jitsu@google.com>
Fri, 3 Oct 2025 21:05:08 +0000 (17:05 -0400)
committerIan Alexander <jitsu@google.com>
Mon, 20 Oct 2025 20:02:33 +0000 (13:02 -0700)
commite94a5008f6bb182231ed4985651a8e6eb19a83cc
treeac1edcc67e87deaa071ab6180a706fe8f102b0e6
parentd9e6f95450134f55d35f63c8da7605019cfda1c3
cmd/go: inject State parameter into `work.runBuild`

This command modifies the call tree starting at `work.runBuild` and
`work.runInstall` 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/work
rf 'inject modload.LoaderState runBuild'
cd ..
./rf-cleanup.zsh
 # cd work
 # rf 'inject modload.LoaderState runInstall'
 # cd ..
 # ./rf-cleanup.zsh

Change-Id: I232452d877211d4ac72f42aa193b30dab9649481
Reviewed-on: https://go-review.googlesource.com/c/go/+/709990
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/work/action.go
src/cmd/go/internal/work/build.go