]> Cypherpunks repositories - gostls13.git/commit
cmd/go: inject State parameter into `bug.runBug`
authorIan Alexander <jitsu@google.com>
Thu, 2 Oct 2025 03:01:55 +0000 (23:01 -0400)
committerIan Alexander <jitsu@google.com>
Mon, 20 Oct 2025 19:50:01 +0000 (12:50 -0700)
commit58a8fdb6cf4a905fd3de44bf2dd87d14fbd38dfe
tree8b9de257203dc6eaa75ae9b6875e71fbc768f5c4
parent8d0bef7ffe5c471684f6a46f579fc7b87a46adb8
cmd/go: inject State parameter into `bug.runBug`

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

Change-Id: Idf87733f586a8aae0779132f54a8d988e2551bae
Reviewed-on: https://go-review.googlesource.com/c/go/+/709982
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/bug/bug.go
src/cmd/go/internal/envcmd/env.go
src/cmd/go/internal/modcmd/edit.go
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/modload/init.go