-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Open
Labels
NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
Description
Failure to parse a boolean flag results in this error:
https://play.golang.org/p/cBBLtiFyWhY:
invalid boolean value "garbage" for -b: strconv.ParseBool: parsing "garbage": invalid syntax
Room for improvement:
- display the offending value only once
- don't mention strconv.ParseBool, as it is an internal detail.
- state what values are allowed, perhaps?
The other strconv.Parse* functions are similarly verbose. I've gotten into the habit of throwing away their errors and writing my own. e.g. "invalid int: %q".
josharian and benhoyt
Metadata
Metadata
Assignees
Labels
NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.