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

Method StringToInt

string_to_int.go:126–130  ·  view source on GitHub ↗

StringToInt defines a string flag with specified name, default value, and usage string. The return value is the address of a map[string]int variable that stores the value of the flag. The value of each argument will not try to be separated by comma

(name string, value map[string]int, usage string)

Source from the content-addressed store, hash-verified

124// The return value is the address of a map[string]int variable that stores the value of the flag.
125// The value of each argument will not try to be separated by comma
126func (f *FlagSet) StringToInt(name string, value map[string]int, usage string) *map[string]int {
127 p := map[string]int{}
128 f.StringToIntVarP(&p, name, "", value, usage)
129 return &p
130}
131
132// StringToIntP is like StringToInt, but accepts a shorthand letter that can be used after a single dash.
133func (f *FlagSet) StringToIntP(name, shorthand string, value map[string]int, usage string) *map[string]int {

Callers

nothing calls this directly

Calls 1

StringToIntVarPMethod · 0.95

Tested by

no test coverage detected