GetDurationSlice returns the []time.Duration value of a flag with the given name
(name string)
| 110 | |
| 111 | // GetDurationSlice returns the []time.Duration value of a flag with the given name |
| 112 | func (f *FlagSet) GetDurationSlice(name string) ([]time.Duration, error) { |
| 113 | val, err := f.getFlagType(name, "durationSlice", durationSliceConv) |
| 114 | if err != nil { |
| 115 | return []time.Duration{}, err |
| 116 | } |
| 117 | return val.([]time.Duration), nil |
| 118 | } |
| 119 | |
| 120 | // DurationSliceVar defines a durationSlice flag with specified name, default value, and usage string. |
| 121 | // The argument p points to a []time.Duration variable in which to store the value of the flag. |