mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
ab2829ec06
commit
c1ef3d5881
1 changed files with 7 additions and 7 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue