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

Method GetCount

count.go:39–45  ·  count.go::FlagSet.GetCount

GetCount return the int value of a flag with the given name

(name string)

Source from the content-addressed store, hash-verified

37
38// GetCount return the int value of a flag with the given name
39func (f *FlagSet) GetCount(name string) (int, error) {
40 val, err := f.getFlagType(name, "count", countConv)
41 if err != nil {
42 return 0, err
43 }
44 return val.(int), nil
45}
46
47// CountVar defines a count flag with specified name, default value, and usage string.
48// The argument p points to an int variable in which to store the value of the flag.

Callers 1

TestCountFunction · 0.80

Calls 1

getFlagTypeMethod · 0.95

Tested by 1

TestCountFunction · 0.64