aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/cgo/internal/testplugin/plugin_test.go
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2025-03-20 10:02:31 +0100
committerQuim Muntal <quimmuntal@gmail.com>2025-03-20 09:10:13 -0700
commite9558d39476199f05bb08e7e32a2df054c3aab1b (patch)
tree9f6d5fe1ffaa6ed4b34e874f998bbd9f522c13f9 /src/cmd/cgo/internal/testplugin/plugin_test.go
parenta4a5ef08bd15201772021620cc3a8331b30643f5 (diff)
downloadgo-e9558d39476199f05bb08e7e32a2df054c3aab1b.tar.xz
all: use exec.Command.String in test logs
There is no need to manually construct a human-friendly string for a exec.Command. The String method does that for us. Change-Id: Iff1033478000bade9cbdc079f6143a7690374258 Reviewed-on: https://go-review.googlesource.com/c/go/+/659475 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/cgo/internal/testplugin/plugin_test.go')
-rw-r--r--src/cmd/cgo/internal/testplugin/plugin_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/cgo/internal/testplugin/plugin_test.go b/src/cmd/cgo/internal/testplugin/plugin_test.go
index 85dfd31123..a8d4c0ea58 100644
--- a/src/cmd/cgo/internal/testplugin/plugin_test.go
+++ b/src/cmd/cgo/internal/testplugin/plugin_test.go
@@ -194,10 +194,10 @@ func run(t *testing.T, bin string, args ...string) string {
out, err := cmd.Output()
if err != nil {
if t == nil {
- log.Panicf("%s: %v\n%s", strings.Join(cmd.Args, " "), err, cmd.Stderr)
+ log.Panicf("%#q: %v\n%s", cmd, err, cmd.Stderr)
} else {
t.Helper()
- t.Fatalf("%s: %v\n%s", strings.Join(cmd.Args, " "), err, cmd.Stderr)
+ t.Fatalf("%#q: %v\n%s", cmd, err, cmd.Stderr)
}
}
@@ -245,7 +245,7 @@ func TestIssue18676(t *testing.T) {
cmd := exec.CommandContext(ctx, "./issue18676.exe")
out, err := cmd.CombinedOutput()
if err != nil {
- t.Fatalf("%s: %v\n%s", strings.Join(cmd.Args, " "), err, out)
+ t.Fatalf("%#q: %v\n%s", cmd, err, out)
}
}