diff options
| author | Ian Alexander <jitsu@google.com> | 2025-11-24 18:36:07 -0500 |
|---|---|---|
| committer | Ian Alexander <jitsu@google.com> | 2025-11-26 09:30:54 -0800 |
| commit | c1ef3d588126f5ed96112f8392db3e63c710b5af (patch) | |
| tree | 423899fb687dd8b3164fff58f1b7c430d9bdfed9 /src/cmd | |
| parent | ab2829ec06cbe7fb1464bcf929fffcd6a7ad68b8 (diff) | |
| download | go-c1ef3d588126f5ed96112f8392db3e63c710b5af.tar.xz | |
cmd/go/internal/modcmd: remove references to modfetch.Fetcher_
This commit removes references to the global modfetch.Fetcher_
variable from the modcmd package.
Change-Id: Ie2966401d1f6964e21ddede65d39ff53fea6e867
Reviewed-on: https://go-review.googlesource.com/c/go/+/724245
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/go/internal/modcmd/download.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cmd/go/internal/modcmd/download.go b/src/cmd/go/internal/modcmd/download.go index 8b94ba1fd5..661cddcd79 100644 --- a/src/cmd/go/internal/modcmd/download.go +++ b/src/cmd/go/internal/modcmd/download.go @@ -264,7 +264,7 @@ func runDownload(ctx context.Context, cmd *base.Command, args []string) { } sem <- token{} go func() { - err := DownloadModule(ctx, m) + err := DownloadModule(ctx, moduleLoaderState.Fetcher(), m) if err != nil { downloadErrs.Store(m, err) m.Error = err.Error() @@ -364,27 +364,27 @@ func runDownload(ctx context.Context, cmd *base.Command, args []string) { // DownloadModule runs 'go mod download' for m.Path@m.Version, // leaving the results (including any error) in m itself. -func DownloadModule(ctx context.Context, m *ModuleJSON) error { +func DownloadModule(ctx context.Context, f *modfetch.Fetcher, m *ModuleJSON) error { var err error - _, file, err := modfetch.Fetcher_.InfoFile(ctx, m.Path, m.Version) + _, file, err := f.InfoFile(ctx, m.Path, m.Version) if err != nil { return err } m.Info = file - m.GoMod, err = modfetch.Fetcher_.GoModFile(ctx, m.Path, m.Version) + m.GoMod, err = f.GoModFile(ctx, m.Path, m.Version) if err != nil { return err } - m.GoModSum, err = modfetch.Fetcher_.GoModSum(ctx, m.Path, m.Version) + m.GoModSum, err = f.GoModSum(ctx, m.Path, m.Version) if err != nil { return err } mod := module.Version{Path: m.Path, Version: m.Version} - m.Zip, err = modfetch.Fetcher_.DownloadZip(ctx, mod) + m.Zip, err = f.DownloadZip(ctx, mod) if err != nil { return err } m.Sum = modfetch.Sum(ctx, mod) - m.Dir, err = modfetch.Fetcher_.Download(ctx, mod) + m.Dir, err = f.Download(ctx, mod) return err } |
