]> Cypherpunks repositories - gostls13.git/commit
cmd/go: use local state object in `list.runList`
authorIan Alexander <jitsu@google.com>
Thu, 9 Oct 2025 00:02:36 +0000 (20:02 -0400)
committerIan Alexander <jitsu@google.com>
Sat, 25 Oct 2025 01:08:37 +0000 (18:08 -0700)
commitea9cf26aa14e815fce7c9e81455062bd55410ad5
tree9e0a963db2b57323875881818dcaf0a09ef20850
parent9926e1124e5dd6397f16f36456aedbee101bc6f3
cmd/go: use local state object in `list.runList`

This commit modifies `list.runList` 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/list
rf '
  add list.go:/func runList\(/-0 var moduleLoaderState *modload.State
  ex {
    import "cmd/go/internal/modload";
    modload.LoaderState -> moduleLoaderState
  }
  add runList://+0 moduleLoaderState := modload.NewState()
  rm list.go:/var moduleLoaderState \*modload.State/
'

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