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

Method GetInt32Slice

int32_slice.go:120–126  ·  view source on GitHub ↗

GetInt32Slice return the []int32 value of a flag with the given name

(name string)

Source from the content-addressed store, hash-verified

118
119// GetInt32Slice return the []int32 value of a flag with the given name
120func (f *FlagSet) GetInt32Slice(name string) ([]int32, error) {
121 val, err := f.getFlagType(name, "int32Slice", int32SliceConv)
122 if err != nil {
123 return []int32{}, err
124 }
125 return val.([]int32), nil
126}
127
128// Int32SliceVar defines a int32Slice flag with specified name, default value, and usage string.
129// The argument p points to a []int32 variable in which to store the value of the flag.

Callers 4

TestEmptyI32SFunction · 0.80
TestI32SFunction · 0.80
TestI32SDefaultFunction · 0.80
TestI32SWithDefaultFunction · 0.80

Calls 1

getFlagTypeMethod · 0.95

Tested by 4

TestEmptyI32SFunction · 0.64
TestI32SFunction · 0.64
TestI32SDefaultFunction · 0.64
TestI32SWithDefaultFunction · 0.64