From d5af8894fe9036e6e97095f53ab3b213ff4d7935 Mon Sep 17 00:00:00 2001 From: Rob Findley Date: Mon, 8 May 2023 13:45:57 -0400 Subject: [PATCH] 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 Reviewed-by: Alan Donovan Run-TryBot: Robert Findley TryBot-Result: Gopher Robot --- gopls/internal/lsp/safetoken/safetoken_test.go | 1 + gopls/test/debug/debug_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/gopls/internal/lsp/safetoken/safetoken_test.go b/gopls/internal/lsp/safetoken/safetoken_test.go index 8f0a30a9dd7..83a50fbec10 100644 --- a/gopls/internal/lsp/safetoken/safetoken_test.go +++ b/gopls/internal/lsp/safetoken/safetoken_test.go @@ -81,6 +81,7 @@ func TestGoplsSourceDoesNotCallTokenFileMethods(t *testing.T) { cfg.Env = os.Environ() cfg.Env = append(cfg.Env, "GOPACKAGESDRIVER=off", + "GOWORK=off", // necessary for -mod=mod below "GOFLAGS=-mod=mod", ) diff --git a/gopls/test/debug/debug_test.go b/gopls/test/debug/debug_test.go index 5ea07fbde38..757dd2f1c70 100644 --- a/gopls/test/debug/debug_test.go +++ b/gopls/test/debug/debug_test.go @@ -54,6 +54,7 @@ func TestTemplates(t *testing.T) { cfg.Env = os.Environ() cfg.Env = append(cfg.Env, "GOPACKAGESDRIVER=off", + "GOWORK=off", // necessary for -mod=mod below "GOFLAGS=-mod=mod", )