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: document purpose of FlagSet.Name #24225

Closed
mark-rushakoff opened this issue Mar 2, 2018 · 1 comment
Closed

flag: document purpose of FlagSet.Name #24225

mark-rushakoff opened this issue Mar 2, 2018 · 1 comment

Comments

@mark-rushakoff
Copy link
Contributor

The godoc for NewFlagSet says

NewFlagSet returns a new, empty flag set with the specified name and error handling property.

and (*FlagSet).Name() says

Name returns the name of the flag set.

But it's unclear to me why a flag set has a name at all. Skimming through the source code, it looks like the name field is only used in (*FlagSet).defaultUsage().

The intent of the name would be more clear if NewFlagSet's godoc mentioned that the name will be used in the default usage, if you do not override the Usage field.

@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone Mar 28, 2018
@gopherbot
Copy link

Change https://golang.org/cl/102955 mentions this issue: flag: document use of FlagSet name parameter

@golang golang locked and limited conversation to collaborators Mar 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants