Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flag: PrintDefaults claims configurability, but doesn't say how #15024

Closed
dsymonds opened this issue Mar 30, 2016 · 4 comments
Closed

flag: PrintDefaults claims configurability, but doesn't say how #15024

dsymonds opened this issue Mar 30, 2016 · 4 comments
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@dsymonds
Copy link
Contributor

https://golang.org/pkg/flag/#PrintDefaults says

PrintDefaults prints, to standard error unless configured otherwise, ...

I couldn't see anywhere how to send its output anywhere else.

I dug through the source code and eventually made my way to (*FlagSet).SetOutput, but that was not at all obvious.

@dsymonds
Copy link
Contributor Author

Also, it'd be nice if one could print the output to an io.Writer without having to mess with the global configuration. I couldn't see how to do that either.

@bradfitz bradfitz added this to the Unplanned milestone Apr 7, 2016
@gopherbot
Copy link

CL https://golang.org/cl/28488 mentions this issue.

@ALTree ALTree added the NeedsFix The path to resolution is known, but the work has not been done. label Jul 18, 2017
@gopherbot
Copy link

Change https://golang.org/cl/85816 mentions this issue: flag: remove confusing text from PrintDefaults functions regarding output

@gopherbot
Copy link

Change https://golang.org/cl/145203 mentions this issue: flag: improve docs for PrintDefaults; clarify how to change output destination

@golang golang locked and limited conversation to collaborators Jan 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants