From: Nodir Turakulov Date: Tue, 6 Oct 2015 00:17:58 +0000 (-0700) Subject: cmd/go: print `go test -help` to stderr X-Git-Tag: go1.6beta1~907 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0a486b8a06cbef96f04ec1294d2683232225da44;p=gostls13.git cmd/go: print `go test -help` to stderr Usage of all commands is printed to stderr, except go test, which is printed to stdout. This is inconsistent. Print `go test -help` to stderr instead. R=rsc@golang.org Change-Id: I079f4788134bf9aedcccc26838879eedad1c925e Reviewed-on: https://go-review.googlesource.com/15434 Reviewed-by: Andrew Gerrand --- diff --git a/src/cmd/go/main.go b/src/cmd/go/main.go index ef035c7130..b66049f0c2 100644 --- a/src/cmd/go/main.go +++ b/src/cmd/go/main.go @@ -285,7 +285,7 @@ func printUsage(w io.Writer) { func usage() { // special case "go test -h" if len(os.Args) > 1 && os.Args[1] == "test" { - os.Stdout.WriteString(testUsage + "\n\n" + + os.Stderr.WriteString(testUsage + "\n\n" + strings.TrimSpace(testFlag1) + "\n\n\t" + strings.TrimSpace(testFlag2) + "\n") os.Exit(2)