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

Method GetFloat32Slice

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

GetFloat32Slice return the []float32 value of a flag with the given name

(name string)

Source from the content-addressed store, hash-verified

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

Callers 4

TestEmptyF32SFunction · 0.80
TestF32SFunction · 0.80
TestF32SDefaultFunction · 0.80
TestF32SWithDefaultFunction · 0.80

Calls 1

getFlagTypeMethod · 0.95

Tested by 4

TestEmptyF32SFunction · 0.64
TestF32SFunction · 0.64
TestF32SDefaultFunction · 0.64
TestF32SWithDefaultFunction · 0.64