@@ -589,7 +589,7 @@ func (c *commandHandler) Vendor(ctx context.Context, args command.URIArg) error
589
589
// modules.txt in-place. In that case we could theoretically allow this
590
590
// command to run concurrently.
591
591
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" })
593
593
if err != nil {
594
594
return err
595
595
}
@@ -751,7 +751,7 @@ func (c *commandHandler) runTests(ctx context.Context, snapshot *cache.Snapshot,
751
751
var failedTests int
752
752
for _ , funcName := range tests {
753
753
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 )
755
755
if err != nil {
756
756
return err
757
757
}
@@ -767,7 +767,7 @@ func (c *commandHandler) runTests(ctx context.Context, snapshot *cache.Snapshot,
767
767
// Run `go test -run=^$ -bench Func` on each test.
768
768
var failedBenchmarks int
769
769
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 {
771
771
pkgPath , "-v" , "-run=^$" , fmt .Sprintf ("-bench=^%s$" , regexp .QuoteMeta (funcName )),
772
772
})
773
773
if err != nil {
@@ -828,7 +828,7 @@ func (c *commandHandler) Generate(ctx context.Context, args command.GenerateArgs
828
828
if args .Recursive {
829
829
pattern = "./..."
830
830
}
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 })
832
832
if err != nil {
833
833
return err
834
834
}
@@ -857,7 +857,7 @@ func (c *commandHandler) GoGetPackage(ctx context.Context, args command.GoGetPac
857
857
}
858
858
defer cleanupModDir ()
859
859
860
- inv , cleanupInvocation , err := snapshot .GoCommandInvocation (true , modURI .DirPath (), "list" ,
860
+ inv , cleanupInvocation , err := snapshot .GoCommandInvocation (cache . NetworkOK , modURI .DirPath (), "list" ,
861
861
[]string {"-f" , "{{.Module.Path}}@{{.Module.Version}}" , "-mod=mod" , "-modfile=" + filepath .Join (tempDir , "go.mod" ), args .Pkg },
862
862
"GOWORK=off" ,
863
863
)
@@ -991,7 +991,7 @@ func addModuleRequire(invoke func(...string) (*bytes.Buffer, error), args []stri
991
991
// TODO(rfindley): inline.
992
992
func (s * server ) getUpgrades (ctx context.Context , snapshot * cache.Snapshot , uri protocol.DocumentURI , modules []string ) (map [string ]string , error ) {
993
993
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 )
995
995
if err != nil {
996
996
return nil , err
997
997
}
0 commit comments