]> Cypherpunks repositories - gostls13.git/commitdiff
debug/buildinfo: use testenv.GoToolPath in tests instead of resolving "go" from ...
authorBryan C. Mills <bcmills@google.com>
Thu, 10 Mar 2022 20:28:10 +0000 (15:28 -0500)
committerBryan Mills <bcmills@google.com>
Mon, 14 Mar 2022 16:33:16 +0000 (16:33 +0000)
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>

src/debug/buildinfo/buildinfo_test.go

index ac71626fda1dfb74be7f869053e548b9b7e9403a..0affc832e718da696b000a1e4bd25c86626eada5 100644 (file)
@@ -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{}