]> Cypherpunks repositories - gostls13.git/commit
cmd/go: inject State parameter into `tool.runTool`
authorIan Alexander <jitsu@google.com>
Wed, 8 Oct 2025 18:58:18 +0000 (14:58 -0400)
committerIan Alexander <jitsu@google.com>
Mon, 20 Oct 2025 19:52:09 +0000 (12:52 -0700)
commita420aa221ecae56d026e55dc64d647aec167f819
treefb07f18e12dcb8f95b1d601d7e43c9a8def60ec9
parent441e7194a44efe5beb98d329db5529bfc658f2e0
cmd/go: inject State parameter into `tool.runTool`

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

Change-Id: Icd1ce189f7dad421eaa2bd43d53ceaf443c5405e
Reviewed-on: https://go-review.googlesource.com/c/go/+/710302
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/tool/tool.go