mirror of
https://github.com/golang/go
synced 2024-09-15 14:10:17 +00:00
flag: improve docs for PrintDefaults; clarify how to change output destination
The existing docs only mention that it is possible to change the output destination of PrintDefaults from the default of standard error, but fail to mention how to actually do so. This change fixes this lack by directing users to CommandLine.SetOutput. Fixes #15024 Change-Id: Ieaa7edbebd23d4ea6fa7e53d97a87143d590bdb3 Reviewed-on: https://go-review.googlesource.com/c/145203 Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
6718bb22fe
commit
e308807f65
|
@ -548,6 +548,8 @@ func (f *FlagSet) PrintDefaults() {
|
||||||
// the output will be
|
// the output will be
|
||||||
// -I directory
|
// -I directory
|
||||||
// search directory for include files.
|
// search directory for include files.
|
||||||
|
//
|
||||||
|
// To change the destination for flag messages, call CommandLine.SetOutput.
|
||||||
func PrintDefaults() {
|
func PrintDefaults() {
|
||||||
CommandLine.PrintDefaults()
|
CommandLine.PrintDefaults()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue