The test was not preserving temporary directory flags leading to a
failure on windows with:
mkdir C:\WINDOWS\go-build315158903: Access is denied.
Fixes #38251
Change-Id: I6ee31b31e84b7f6e75ea6ee0f3b8c094835bf5d2
Reviewed-on: https://go-review.googlesource.com/c/go/+/227497
Reviewed-by: David Chase <drchase@google.com>
t.Log(run)
cmd := exec.Command(run[0], run[1:]...)
cmd.Dir = dir
- cmd.Env = []string{"GOARCH=" + goarch, "GOOS=" + goos}
+ cmd.Env = append(os.Environ(), "GOARCH="+goarch, "GOOS="+goos)
out, err := cmd.CombinedOutput()
t.Logf("%s", out)
return string(out), err