]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: print `go test -help` to stderr
authorNodir Turakulov <nodir@google.com>
Tue, 6 Oct 2015 00:17:58 +0000 (17:17 -0700)
committerAndrew Gerrand <adg@golang.org>
Tue, 6 Oct 2015 01:11:30 +0000 (01:11 +0000)
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 <adg@golang.org>
src/cmd/go/main.go

index ef035c713023013b8fb8f761cd518bb764ce86aa..b66049f0c28d1b3091a20a1e85ecaa35b4bf923a 100644 (file)
@@ -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)