If GOBIN is not empty the build moves the go executable
to a new path. When this test runs it fails to find the
go cmd in the GOROOT.
Change-Id: I100def0fbcb9691b13776f795b1d1725e36d8102
Reviewed-on: https://go-review.googlesource.com/8735
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
if err != nil {
t.Fatal(err)
}
+ gofolder := filepath.Join(build.Default.GOROOT, "bin")
+ if gobin := os.Getenv("GOBIN"); len(gobin) != 0 {
+ gofolder = gobin
+ }
+
cmd := exec.Command(
- build.Default.GOROOT+"/bin/go", "tool", "asm", "-S", "-dynlink",
+ filepath.Join(gofolder, "go"), "tool", "asm", "-S", "-dynlink",
"-o", filepath.Join(tmpdir, "output.6"), tmpfile.Name())
var env []string