From: Bryan C. Mills Date: Thu, 10 Mar 2022 20:28:10 +0000 (-0500) Subject: debug/buildinfo: use testenv.GoToolPath in tests instead of resolving "go" from ... X-Git-Tag: go1.19beta1~1080 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=471d319fb2497aa7239943eb1a6d5cfbad503a2a;p=gostls13.git 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 Run-TryBot: Bryan Mills TryBot-Result: Gopher Robot Reviewed-by: Daniel Martí Trust: Daniel Martí --- 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{}