mirror of
https://github.com/golang/go
synced 2024-11-19 02:04:42 -07:00
go/analysis/singlechecker: use Stderr in flag.Usage
It was using a mix of stdout and stderr. Most users won't notice, but it's inconsistent for no apparent reason. In particular, I noticed as some of my tool execution tests started failing. Change-Id: I9afe5f5bed0a575d3ba20e8dc1cc593c35565cf9 Reviewed-on: https://go-review.googlesource.com/c/162717 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
parent
508f945e1a
commit
c161412db0
@ -52,11 +52,11 @@ func Main(a *analysis.Analyzer) {
|
|||||||
flag.Usage = func() {
|
flag.Usage = func() {
|
||||||
paras := strings.Split(a.Doc, "\n\n")
|
paras := strings.Split(a.Doc, "\n\n")
|
||||||
fmt.Fprintf(os.Stderr, "%s: %s\n\n", a.Name, paras[0])
|
fmt.Fprintf(os.Stderr, "%s: %s\n\n", a.Name, paras[0])
|
||||||
fmt.Printf("Usage: %s [-flag] [package]\n\n", a.Name)
|
fmt.Fprintf(os.Stderr, "Usage: %s [-flag] [package]\n\n", a.Name)
|
||||||
if len(paras) > 1 {
|
if len(paras) > 1 {
|
||||||
fmt.Println(strings.Join(paras[1:], "\n\n"))
|
fmt.Fprintln(os.Stderr, strings.Join(paras[1:], "\n\n"))
|
||||||
}
|
}
|
||||||
fmt.Println("\nFlags:")
|
fmt.Fprintf(os.Stderr, "\nFlags:")
|
||||||
flag.PrintDefaults()
|
flag.PrintDefaults()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user