Skip to content

Commit d5af889

Browse files
committed
gopls: set GOWORK=off for loads from debug and safetoken tests
Using -mod=mod when calling go/packages.Load causes tests to fail when GOWORK is set, so set GOWORK=off explicitly. Change-Id: I3b25bd7042c23bfe10223cb466a10e1accaf2ba0 Reviewed-on: https://go-review.googlesource.com/c/tools/+/493615 gopls-CI: kokoro <[email protected]> Reviewed-by: Alan Donovan <[email protected]> Run-TryBot: Robert Findley <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent c93329a commit d5af889

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

gopls/internal/lsp/safetoken/safetoken_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func TestGoplsSourceDoesNotCallTokenFileMethods(t *testing.T) {
8181
cfg.Env = os.Environ()
8282
cfg.Env = append(cfg.Env,
8383
"GOPACKAGESDRIVER=off",
84+
"GOWORK=off", // necessary for -mod=mod below
8485
"GOFLAGS=-mod=mod",
8586
)
8687

gopls/test/debug/debug_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func TestTemplates(t *testing.T) {
5454
cfg.Env = os.Environ()
5555
cfg.Env = append(cfg.Env,
5656
"GOPACKAGESDRIVER=off",
57+
"GOWORK=off", // necessary for -mod=mod below
5758
"GOFLAGS=-mod=mod",
5859
)
5960

0 commit comments

Comments
 (0)