aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2025-01-31 12:39:19 -0800
committerGopher Robot <gobot@golang.org>2025-02-03 08:20:05 -0800
commit4f11d5879a01e64cb8bd59911bb205ffedd4f265 (patch)
treee951115039fdd6ef2baf66f95406d7b68ca9a289 /src
parent5aa3d162d526af778c47695ec03b8c8b0ddd7843 (diff)
downloadgo-4f11d5879a01e64cb8bd59911bb205ffedd4f265.tar.xz
crypto/internal/cryptotest: print stderr if go tool fails
Trying to find out why "go env GOMODCACHE" is failing on the Windows longtest builder. For #71508 Change-Id: I0642d5a5d85a549c6edde0be5bed8f0a16cca200 Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/645895 Reviewed-by: Roland Shoemaker <roland@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src')
-rw-r--r--src/crypto/internal/cryptotest/fetchmodule.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/crypto/internal/cryptotest/fetchmodule.go b/src/crypto/internal/cryptotest/fetchmodule.go
index 740b17b001..37f2a09497 100644
--- a/src/crypto/internal/cryptotest/fetchmodule.go
+++ b/src/crypto/internal/cryptotest/fetchmodule.go
@@ -9,6 +9,7 @@ import (
"encoding/json"
"internal/testenv"
"os"
+ "os/exec"
"testing"
)
@@ -23,7 +24,11 @@ func FetchModule(t *testing.T, module, version string) string {
// instead. (For example, run.bash sets GOPATH=/nonexist-gopath.)
out, err := testenv.Command(t, goTool, "env", "GOMODCACHE").Output()
if err != nil {
- t.Fatalf("%s env GOMODCACHE: %v\n%s", goTool, err, out)
+ t.Errorf("%s env GOMODCACHE: %v\n%s", goTool, err, out)
+ if ee, ok := err.(*exec.ExitError); ok {
+ t.Logf("%s", ee.Stderr)
+ }
+ t.FailNow()
}
modcacheOk := false
if gomodcache := string(bytes.TrimSpace(out)); gomodcache != "" {