@@ -589,7 +589,7 @@ func (c *commandHandler) Vendor(ctx context.Context, args command.URIArg) error
589589 // modules.txt in-place. In that case we could theoretically allow this
590590 // command to run concurrently.
591591 stderr := new (bytes.Buffer )
592- inv , cleanupInvocation , err := deps .snapshot .GoCommandInvocation (true , args .URI .DirPath (), "mod" , []string {"vendor" })
592+ inv , cleanupInvocation , err := deps .snapshot .GoCommandInvocation (cache . NetworkOK , args .URI .DirPath (), "mod" , []string {"vendor" })
593593 if err != nil {
594594 return err
595595 }
@@ -751,7 +751,7 @@ func (c *commandHandler) runTests(ctx context.Context, snapshot *cache.Snapshot,
751751 var failedTests int
752752 for _ , funcName := range tests {
753753 args := []string {pkgPath , "-v" , "-count=1" , fmt .Sprintf ("-run=^%s$" , regexp .QuoteMeta (funcName ))}
754- inv , cleanupInvocation , err := snapshot .GoCommandInvocation (false , uri .DirPath (), "test" , args )
754+ inv , cleanupInvocation , err := snapshot .GoCommandInvocation (cache . NoNetwork , uri .DirPath (), "test" , args )
755755 if err != nil {
756756 return err
757757 }
@@ -767,7 +767,7 @@ func (c *commandHandler) runTests(ctx context.Context, snapshot *cache.Snapshot,
767767 // Run `go test -run=^$ -bench Func` on each test.
768768 var failedBenchmarks int
769769 for _ , funcName := range benchmarks {
770- inv , cleanupInvocation , err := snapshot .GoCommandInvocation (false , uri .DirPath (), "test" , []string {
770+ inv , cleanupInvocation , err := snapshot .GoCommandInvocation (cache . NoNetwork , uri .DirPath (), "test" , []string {
771771 pkgPath , "-v" , "-run=^$" , fmt .Sprintf ("-bench=^%s$" , regexp .QuoteMeta (funcName )),
772772 })
773773 if err != nil {
@@ -828,7 +828,7 @@ func (c *commandHandler) Generate(ctx context.Context, args command.GenerateArgs
828828 if args .Recursive {
829829 pattern = "./..."
830830 }
831- inv , cleanupInvocation , err := deps .snapshot .GoCommandInvocation (true , args .Dir .Path (), "generate" , []string {"-x" , pattern })
831+ inv , cleanupInvocation , err := deps .snapshot .GoCommandInvocation (cache . NetworkOK , args .Dir .Path (), "generate" , []string {"-x" , pattern })
832832 if err != nil {
833833 return err
834834 }
@@ -857,7 +857,7 @@ func (c *commandHandler) GoGetPackage(ctx context.Context, args command.GoGetPac
857857 }
858858 defer cleanupModDir ()
859859
860- inv , cleanupInvocation , err := snapshot .GoCommandInvocation (true , modURI .DirPath (), "list" ,
860+ inv , cleanupInvocation , err := snapshot .GoCommandInvocation (cache . NetworkOK , modURI .DirPath (), "list" ,
861861 []string {"-f" , "{{.Module.Path}}@{{.Module.Version}}" , "-mod=mod" , "-modfile=" + filepath .Join (tempDir , "go.mod" ), args .Pkg },
862862 "GOWORK=off" ,
863863 )
@@ -991,7 +991,7 @@ func addModuleRequire(invoke func(...string) (*bytes.Buffer, error), args []stri
991991// TODO(rfindley): inline.
992992func (s * server ) getUpgrades (ctx context.Context , snapshot * cache.Snapshot , uri protocol.DocumentURI , modules []string ) (map [string ]string , error ) {
993993 args := append ([]string {"-mod=readonly" , "-m" , "-u" , "-json" }, modules ... )
994- inv , cleanup , err := snapshot .GoCommandInvocation (true , uri .DirPath (), "list" , args )
994+ inv , cleanup , err := snapshot .GoCommandInvocation (cache . NetworkOK , uri .DirPath (), "list" , args )
995995 if err != nil {
996996 return nil , err
997997 }
0 commit comments