diff --git a/cmd/gvm/use_test.go b/cmd/gvm/use_test.go index 06136e6..a587af5 100644 --- a/cmd/gvm/use_test.go +++ b/cmd/gvm/use_test.go @@ -2,6 +2,7 @@ package main import ( "bytes" + "errors" "fmt" "io" "os" @@ -73,7 +74,12 @@ func TestGVMRunUse(t *testing.T) { // Test that GOROOT/bin/go exists and is the correct version. version, err := exec.Command(filepath.Join(goroot, "bin", "go"), "version").Output() if err != nil { - t.Fatal("failed to run go version", err) + var exitErr *exec.ExitError + if errors.As(err, &exitErr) { + t.Fatalf("failed to run go version: %v\n%s", err, exitErr.Stderr) + } else { + t.Fatal("failed to run go version", err) + } } assert.Contains(t, string(version), tc.Version) })