]> Cypherpunks repositories - gostls13.git/commit
cmd/go: inject State parameter into `modcmd.runDownload`
authorIan Alexander <jitsu@google.com>
Wed, 8 Oct 2025 18:51:13 +0000 (14:51 -0400)
committerIan Alexander <jitsu@google.com>
Mon, 20 Oct 2025 19:56:59 +0000 (12:56 -0700)
commite176dff41c42208d977e3c7adda4484febb73ec0
treebe6d3aca9a66cc79a0718cbc51b2cb8c0995cce7
parente7c66a58d50b93c2cd1a4eb51a437d750757177e
cmd/go: inject State parameter into `modcmd.runDownload`

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

Change-Id: I64cce3e631a2614b7fabe49205d9d41fc9ba24de
Reviewed-on: https://go-review.googlesource.com/c/go/+/710299
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/go/internal/modcmd/download.go
src/cmd/go/internal/modcmd/graph.go
src/cmd/go/internal/modcmd/verify.go
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/modload/buildlist.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/workcmd/sync.go