Change information
Commit message:
cmd/go: refactor usage of `requirements`
This commit refactors usage of the global variable `requirements` 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 { requirements -> LoaderState.requirements }'
rf 'add State.MainModules \
// requirements is the requirement graph for the main module.\
//\
// It is always non-nil if the main module'\\\''s go.mod file has been\
// loaded.\
//\
// This variable should only be read from the loadModFile\
// function, and should only be written in the loadModFile and\
// commitRequirements functions. All other functions that need or\
// produce a *Requirements should accept and/or return an explicit\
// parameter.'
rf 'rm requirements'
Change-Id: I9d7d1d301a9e89f9214ce632fa5b656dd2940f39
Files:
- M src/cmd/go/internal/modload/buildlist.go
- M src/cmd/go/internal/modload/init.go
- M src/cmd/go/internal/modload/list.go
- M src/cmd/go/internal/modload/load.go
Change size: M
Delta: 4 files changed, 40 insertions(+), 39 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Code-Review: +1 by Michael Matloob, +2 by Michael Matloob
TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI