]> Cypherpunks repositories - gostls13.git/commit
cmd/go: inject State parameter into `test.runTest`
authorIan Alexander <jitsu@google.com>
Thu, 2 Oct 2025 13:43:40 +0000 (09:43 -0400)
committerIan Alexander <jitsu@google.com>
Mon, 20 Oct 2025 19:51:33 +0000 (12:51 -0700)
commit441e7194a44efe5beb98d329db5529bfc658f2e0
tree1e75d74928e1ea0ace6cea603fdb2358647cdefe
parent35e8309be2a8027a6c20847ab4a8eb6031fd7aeb
cmd/go: inject State parameter into `test.runTest`

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

Change-Id: I6ee495c3beabdc5568ad338f4998a5927491db1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/709986
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/load/pkg.go
src/cmd/go/internal/test/test.go
src/cmd/go/internal/vet/vet.go
src/cmd/go/internal/work/action.go