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

Method GetUint16

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

GetUint16 return the uint16 value of a flag with the given name

(name string)

Source from the content-addressed store, hash-verified

32
33// GetUint16 return the uint16 value of a flag with the given name
34func (f *FlagSet) GetUint16(name string) (uint16, error) {
35 val, err := f.getFlagType(name, "uint16", uint16Conv)
36 if err != nil {
37 return 0, err
38 }
39 return val.(uint16), nil
40}
41
42// Uint16Var 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