-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
If I have a cli with a duration flag that is not required and has no default, it will always panic with the message:
panic: time: invalid duration
this happens whether or not the user provides a value on the command line. Turns out this panic arises in the default-parsing code:
Lines 51 to 54 in b9b4547
| func (f DurationFlag) Default() interface{} { | |
| dur, err := f.Parse(f.DefaultStr()) | |
| if err != nil { | |
| panic(err) |
We should have better messaging to ensure developers aren't confused when the panic happens.
Metadata
Metadata
Assignees
Labels
No labels