diff --git a/go/packages/packagestest/modules.go b/go/packages/packagestest/modules.go index 42b62067a8d..2c435674747 100644 --- a/go/packages/packagestest/modules.go +++ b/go/packages/packagestest/modules.go @@ -174,7 +174,7 @@ func (modules) Finalize(exported *Exported) error { // stuff in cache. All the files created by Export should be recreated. inv := gocommand.Invocation{ Verb: "mod", - Args: []string{"download"}, + Args: []string{"download", "all"}, Env: exported.Config.Env, BuildFlags: exported.Config.BuildFlags, WorkingDir: exported.Config.Dir, diff --git a/internal/imports/mod_test.go b/internal/imports/mod_test.go index 91863efacab..51bc9679184 100644 --- a/internal/imports/mod_test.go +++ b/internal/imports/mod_test.go @@ -709,7 +709,7 @@ func setup(t *testing.T, main, wd string) *modTest { t.Fatalf("checking if go.mod exists: %v", err) } if err == nil { - if _, err := env.invokeGo(context.Background(), "mod", "download"); err != nil { + if _, err := env.invokeGo(context.Background(), "mod", "download", "all"); err != nil { t.Fatal(err) } }