Skip to content

Commit 0a486b8

Browse files
nodirtadg
authored andcommitted
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. [email protected] Change-Id: I079f4788134bf9aedcccc26838879eedad1c925e Reviewed-on: https://go-review.googlesource.com/15434 Reviewed-by: Andrew Gerrand <[email protected]>
1 parent f23c37f commit 0a486b8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/cmd/go/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func printUsage(w io.Writer) {
285285
func usage() {
286286
// special case "go test -h"
287287
if len(os.Args) > 1 && os.Args[1] == "test" {
288-
os.Stdout.WriteString(testUsage + "\n\n" +
288+
os.Stderr.WriteString(testUsage + "\n\n" +
289289
strings.TrimSpace(testFlag1) + "\n\n\t" +
290290
strings.TrimSpace(testFlag2) + "\n")
291291
os.Exit(2)

0 commit comments

Comments
 (0)