]> git.feebdaed.xyz Git - 0xmirror/go.git/commit
cmd/go/internal/modfetch: rename State to Fetcher
authorIan Alexander <jitsu@google.com>
Mon, 17 Nov 2025 21:38:22 +0000 (16:38 -0500)
committerIan Alexander <jitsu@google.com>
Tue, 25 Nov 2025 04:44:29 +0000 (20:44 -0800)
commit1dc1505d4ad0d3a3172d90e16858697b0dca0ab7
treed25e9d94939ebfc51db52a4beb4486a25dad60bf
parentd3e11b3f9011a08600a14fdbb94a9ca9da970344
cmd/go/internal/modfetch: rename State to Fetcher

This change renames the type State to Fetcher to better reflect its
purpose.  The global variable ModuleFetchState is also renamed to
Fetcher_, which will continue to be gradually eliminated as with all
global state in the modfetch package.

[git-generate]
cd src/cmd/go/internal/modfetch
rf '
  mv State Fetcher
  mv ModuleFetchState Fetcher_
  mv NewState NewFetcher

  mv Fetcher.GoSumFile GoSumFile
  mv GoSumFile.s GoSumFile.f
  mv GoSumFile Fetcher.GoSumFile

  mv Fetcher.SetGoSumFile SetGoSumFile
  mv SetGoSumFile.s SetGoSumFile.f
  mv SetGoSumFile Fetcher.SetGoSumFile

  mv Fetcher.AddWorkspaceGoSumFile AddWorkspaceGoSumFile
  mv AddWorkspaceGoSumFile.s AddWorkspaceGoSumFile.f
  mv AddWorkspaceGoSumFile Fetcher.AddWorkspaceGoSumFile
'
rf '
  add NewFetcher:+0 f := new(Fetcher) \
  f.lookupCache = new(par.Cache[lookupCacheKey, Repo]) \
  f.downloadCache = new(par.ErrCache[module.Version, string]) \
  return f
'
rf 'rm NewFetcher:+5,8'
cd ../modload
rf '
  mv State.modfetchState State.fetcher
'

Change-Id: I7cb6c945ea0f1d2119e1615064f041e88c81c689
Reviewed-on: https://go-review.googlesource.com/c/go/+/721740
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
src/cmd/go/internal/modfetch/fetch.go
src/cmd/go/internal/modfetch/repo.go
src/cmd/go/internal/modload/init.go