mirror of
https://github.com/golang/go
synced 2024-09-29 21:34:28 -06:00
cmd/dist: forward stderr if 'go env CGO_ENABLED' fails
The default error string for a command failure is just its status code, and "exit status 1" is not at all helpful for debugging. Change-Id: I822c89bcc9e73283b33e01792bf9c40b1add3c35 Reviewed-on: https://go-review.googlesource.com/c/go/+/222308 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org>
This commit is contained in:
parent
5ea58c6346
commit
1d90e1a0ac
6
src/cmd/dist/test.go
vendored
6
src/cmd/dist/test.go
vendored
@ -98,9 +98,11 @@ func (t *tester) run() {
|
|||||||
os.Setenv("PATH", fmt.Sprintf("%s%c%s", gobin, os.PathListSeparator, os.Getenv("PATH")))
|
os.Setenv("PATH", fmt.Sprintf("%s%c%s", gobin, os.PathListSeparator, os.Getenv("PATH")))
|
||||||
}
|
}
|
||||||
|
|
||||||
slurp, err := exec.Command("go", "env", "CGO_ENABLED").Output()
|
cmd := exec.Command("go", "env", "CGO_ENABLED")
|
||||||
|
cmd.Stderr = new(bytes.Buffer)
|
||||||
|
slurp, err := cmd.Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatalf("Error running go env CGO_ENABLED: %v", err)
|
fatalf("Error running go env CGO_ENABLED: %v\n%s", err, cmd.Stderr)
|
||||||
}
|
}
|
||||||
t.cgoEnabled, _ = strconv.ParseBool(strings.TrimSpace(string(slurp)))
|
t.cgoEnabled, _ = strconv.ParseBool(strings.TrimSpace(string(slurp)))
|
||||||
if flag.NArg() > 0 && t.runRxStr != "" {
|
if flag.NArg() > 0 && t.runRxStr != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user