MCPcopy
hub / github.com/spf13/pflag / DurationVar

Method DurationVar

duration.go:42–44  ·  view source on GitHub ↗

DurationVar defines a time.Duration flag with specified name, default value, and usage string. The argument p points to a time.Duration variable in which to store the value of the flag.

(p *time.Duration, name string, value time.Duration, usage string)

Source from the content-addressed store, hash-verified

40// DurationVar defines a time.Duration flag with specified name, default value, and usage string.
41// The argument p points to a time.Duration variable in which to store the value of the flag.
42func (f *FlagSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string) {
43 f.VarP(newDurationValue(value, p), name, "", usage)
44}
45
46// DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash.
47func (f *FlagSet) DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) {

Callers 1

CopyToGoFlagSetMethod · 0.80

Calls 2

VarPMethod · 0.95
newDurationValueFunction · 0.85

Tested by

no test coverage detected