]> Cypherpunks repositories - gostls13.git/commit
cmd/go: use local state object in `bug.runBug`
authorIan Alexander <jitsu@google.com>
Wed, 8 Oct 2025 23:56:51 +0000 (19:56 -0400)
committerIan Alexander <jitsu@google.com>
Sat, 25 Oct 2025 01:08:21 +0000 (18:08 -0700)
commit9926e1124e5dd6397f16f36456aedbee101bc6f3
treee438ea437c131099f3dcebd0b060cbd0ae1a4c9b
parent2c4fd7b2cd08234fe13c0e9de8d42dba33086a81
cmd/go: use local state object in `bug.runBug`

This commit modifies `bug.runBug` to construct a new modload.State
object using the new constructor instead of the current global
`modload.LoaderState` variable.

This commit is part of the overall effort to eliminate global
modloader state.

[git-generate]
cd src/cmd/go/internal/bug
rf '
  add bug.go:/func runBug\(/-0 var moduleLoaderState *modload.State
  ex {
    import "cmd/go/internal/modload";
    modload.LoaderState -> moduleLoaderState
  }
  add runBug://+0 moduleLoaderState := modload.NewState()
  rm bug.go:/var moduleLoaderState \*modload.State/
'

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