1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:54:42 -07:00

cmd/vet: print help to stdout only

Previously help for flags was printed to stderr.
This CL makes all the output to be printed to stdout.

Updates golang/go#31885

Change-Id: If95edeccd79581326502dd5c7fc2b49d8f160be7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/175900
Reviewed-by: Ian Cottrell <iancottrell@google.com>
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Yury Smolsky 2019-05-09 12:33:11 +03:00
parent 3eedecdc80
commit 35884eef20

View File

@ -4,6 +4,7 @@ import (
"flag"
"fmt"
"log"
"os"
"sort"
"strings"
@ -47,6 +48,7 @@ func Help(progname string, analyzers []*analysis.Analyzer, args []string) {
fs.Var(f.Value, f.Name, f.Usage)
}
})
fs.SetOutput(os.Stdout)
fs.PrintDefaults()
fmt.Printf("\nTo see details and flags of a specific analyzer, run '%s help name'.\n", progname)
@ -75,6 +77,7 @@ outer:
}
fs.Var(f.Value, a.Name+"."+f.Name, f.Usage)
})
fs.SetOutput(os.Stdout)
fs.PrintDefaults()
if len(paras) > 1 {