We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
go version
1 parent be027e2 commit 96a6dd7Copy full SHA for 96a6dd7
go/extractor/toolchain/toolchain.go
@@ -25,7 +25,7 @@ func GetEnvGoVersion() string {
25
// download the version of Go specified in there. That may either fail or result in us just
26
// being told what's already in 'go.mod'. Setting 'GOTOOLCHAIN' to 'local' will force it
27
// to use the local Go toolchain instead.
28
- cmd := exec.Command("go", "version")
+ cmd := Version()
29
cmd.Env = append(os.Environ(), "GOTOOLCHAIN=local")
30
out, err := cmd.CombinedOutput()
31
@@ -92,3 +92,9 @@ func VendorModule(path string) *exec.Cmd {
92
modVendor.Dir = path
93
return modVendor
94
}
95
+
96
+// Constructs a command to run `go version`.
97
+func Version() *exec.Cmd {
98
+ version := exec.Command("go", "version")
99
+ return version
100
+}
0 commit comments