aboutsummaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2022-03-10 15:28:10 -0500
committerBryan Mills <bcmills@google.com>2022-03-14 16:33:16 +0000
commit471d319fb2497aa7239943eb1a6d5cfbad503a2a (patch)
treec0c348e3081d7f451adceca6563c9e6da3936534 /src/debug
parent7900576bac4630bbeec7f4f1aa4b1cb0d51bd8a1 (diff)
downloadgo-471d319fb2497aa7239943eb1a6d5cfbad503a2a.tar.xz
debug/buildinfo: use testenv.GoToolPath in tests instead of resolving "go" from $PATH
Updates #37475. Change-Id: I8c3237438da3e9521ce3be26a0b5d5ca36944b17 Reviewed-on: https://go-review.googlesource.com/c/go/+/391803 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Trust: Daniel Martí <mvdan@mvdan.cc>
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/buildinfo/buildinfo_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/debug/buildinfo/buildinfo_test.go b/src/debug/buildinfo/buildinfo_test.go
index ac71626fda..0affc832e7 100644
--- a/src/debug/buildinfo/buildinfo_test.go
+++ b/src/debug/buildinfo/buildinfo_test.go
@@ -66,7 +66,7 @@ func TestReadFile(t *testing.T) {
t.Fatal(err)
}
outPath := filepath.Join(dir, path.Base(t.Name()))
- cmd := exec.Command("go", "build", "-o="+outPath)
+ cmd := exec.Command(testenv.GoToolPath(t), "build", "-o="+outPath)
cmd.Dir = dir
cmd.Env = append(os.Environ(), "GO111MODULE=on", "GOOS="+goos, "GOARCH="+goarch)
stderr := &bytes.Buffer{}
@@ -89,7 +89,7 @@ func TestReadFile(t *testing.T) {
t.Fatal(err)
}
outPath := filepath.Join(gopathDir, path.Base(t.Name()))
- cmd := exec.Command("go", "build", "-o="+outPath)
+ cmd := exec.Command(testenv.GoToolPath(t), "build", "-o="+outPath)
cmd.Dir = pkgDir
cmd.Env = append(os.Environ(), "GO111MODULE=off", "GOPATH="+gopathDir, "GOOS="+goos, "GOARCH="+goarch)
stderr := &bytes.Buffer{}