Duration defines a time.Duration flag with specified name, default value, and usage string. The return value is the address of a time.Duration variable that stores the value of the flag.
(name string, value time.Duration, usage string)
| 62 | // Duration defines a time.Duration flag with specified name, default value, and usage string. |
| 63 | // The return value is the address of a time.Duration variable that stores the value of the flag. |
| 64 | func (f *FlagSet) Duration(name string, value time.Duration, usage string) *time.Duration { |
| 65 | p := new(time.Duration) |
| 66 | f.DurationVarP(p, name, "", value, usage) |
| 67 | return p |
| 68 | } |
| 69 | |
| 70 | // DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash. |
| 71 | func (f *FlagSet) DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration { |