File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
gopls/internal/test/integration/workspace Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 5
5
package workspace
6
6
7
7
import (
8
+ "os"
8
9
"os/exec"
9
10
"path/filepath"
10
11
"runtime"
@@ -36,7 +37,12 @@ func TestStdWorkspace(t *testing.T) {
36
37
37
38
// Query GOROOT. This is slightly more precise than e.g. runtime.GOROOT, as
38
39
// it queries the go command in the environment.
39
- goroot , err := exec .Command ("go" , "env" , "GOROOT" ).Output ()
40
+ cmd := exec .Command ("go" , "env" , "GOROOT" )
41
+ // Run with GOTOOLCHAIN=local so as to not be affected by toolchain upgrades
42
+ // in the current directory (which is affected by gopls' go.mod file).
43
+ // This was golang/go#70187
44
+ cmd .Env = append (os .Environ (), "GOTOOLCHAIN=local" )
45
+ goroot , err := cmd .Output ()
40
46
if err != nil {
41
47
t .Fatal (err )
42
48
}
You can’t perform that action at this time.
0 commit comments