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

Method GetUint

uint.go:34–40  ·  view source on GitHub ↗

GetUint return the uint value of a flag with the given name

(name string)

Source from the content-addressed store, hash-verified

32
33// GetUint return the uint value of a flag with the given name
34func (f *FlagSet) GetUint(name string) (uint, error) {
35 val, err := f.getFlagType(name, "uint", uintConv)
36 if err != nil {
37 return 0, err
38 }
39 return val.(uint), nil
40}
41
42// UintVar defines a uint flag with specified name, default value, and usage string.
43// The argument p points to a uint variable in which to store the value of the flag.

Callers 1

testParseFunction · 0.80

Calls 1

getFlagTypeMethod · 0.95

Tested by 1

testParseFunction · 0.64