]> Cypherpunks repositories - gostls13.git/commit
cmd/go: refactor usage of `workFilePath`
authorIan Alexander <jitsu@google.com>
Thu, 21 Aug 2025 01:21:41 +0000 (21:21 -0400)
committerIan Alexander <jitsu@google.com>
Tue, 7 Oct 2025 23:10:28 +0000 (16:10 -0700)
commit78b43037dc20b9f5d624260b50e15bfa8956e4d5
treeaaef1a7efef04909780b64960bd8ba41b5c3ca08
parentbb1ca7ae81ea8ca49a2773ace8ccff8fbc7f4dfd
cmd/go: refactor usage of `workFilePath`

This commit refactors usage of the global variable `workFilePath` to
the global LoaderState field of the same name.

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

[git-generate]
cd src/cmd/go/internal/modload
rf 'ex { workFilePath -> LoaderState.workFilePath }'
rf 'add State.requirements \
// Set to the path to the go.work file, or "" if workspace mode is\
// disabled'
rf 'rm workFilePath'

Change-Id: I53cdbc3cc619914421513db74a74a04ab10b3e33
Reviewed-on: https://go-review.googlesource.com/c/go/+/698062
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/modload/buildlist.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/modload/modfile.go