From e9558d39476199f05bb08e7e32a2df054c3aab1b Mon Sep 17 00:00:00 2001 From: qmuntal Date: Thu, 20 Mar 2025 10:02:31 +0100 Subject: 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 Reviewed-by: Cherry Mui LUCI-TryBot-Result: Go LUCI --- src/os/exec/read3.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/os/exec') diff --git a/src/os/exec/read3.go b/src/os/exec/read3.go index 8327d73e51..3ccf1cacc8 100644 --- a/src/os/exec/read3.go +++ b/src/os/exec/read3.go @@ -20,7 +20,6 @@ import ( "os/exec" "os/exec/internal/fdtest" "runtime" - "strings" ) func main() { @@ -81,7 +80,7 @@ func main() { cmd := exec.Command(ofcmd, args...) out, err := cmd.CombinedOutput() if err != nil { - fmt.Fprintf(os.Stderr, "%s failed: %v\n", strings.Join(cmd.Args, " "), err) + fmt.Fprintf(os.Stderr, "%#q failed: %v\n", cmd, err) } fmt.Printf("%s", out) os.Exit(1) -- cgit v1.3