From a6a7c7a1fd6a2450cfec11e54217e04dce843a54 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Fri, 28 Jan 2022 16:18:22 -0500 Subject: [PATCH] cmd/go: add detail to test failures For #50892 Change-Id: I14ff1c43b39687a0ba5e668ee962cecfb49e4beb Reviewed-on: https://go-review.googlesource.com/c/go/+/381836 Trust: Bryan Mills Run-TryBot: Bryan Mills Reviewed-by: Dmitri Shuralyov Reviewed-by: Michael Matloob TryBot-Result: Gopher Robot --- src/cmd/go/go_test.go | 2 +- src/cmd/go/script_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 7aaec4eb9864e8..1ea347ca6e5dbd 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -133,7 +133,7 @@ func TestMain(m *testing.M) { } gotool, err := testenv.GoTool() if err != nil { - fmt.Fprintln(os.Stderr, err) + fmt.Fprintln(os.Stderr, "locating go tool: ", err) os.Exit(2) } diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go index 165d3308a8ec17..722921f74c3d34 100644 --- a/src/cmd/go/script_test.go +++ b/src/cmd/go/script_test.go @@ -902,7 +902,7 @@ func (ts *testScript) cmdStale(want simpleStatus, args []string) { tmpl := "{{if .Error}}{{.ImportPath}}: {{.Error.Err}}{{else}}" switch want { case failure: - tmpl += "{{if .Stale}}{{.ImportPath}} is unexpectedly stale{{end}}" + tmpl += "{{if .Stale}}{{.ImportPath}} is unexpectedly stale: {{.StaleReason}}{{end}}" case success: tmpl += "{{if not .Stale}}{{.ImportPath}} is unexpectedly NOT stale{{end}}" default: