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

Method GetIPNetSlice

ipnet_slice.go:93–99  ·  view source on GitHub ↗

GetIPNetSlice returns the []net.IPNet value of a flag with the given name

(name string)

Source from the content-addressed store, hash-verified

91
92// GetIPNetSlice returns the []net.IPNet value of a flag with the given name
93func (f *FlagSet) GetIPNetSlice(name string) ([]net.IPNet, error) {
94 val, err := f.getFlagType(name, "ipNetSlice", ipNetSliceConv)
95 if err != nil {
96 return []net.IPNet{}, err
97 }
98 return val.([]net.IPNet), nil
99}
100
101// IPNetSliceVar defines a ipNetSlice flag with specified name, default value, and usage string.
102// The argument p points to a []net.IPNet variable in which to store the value of the flag.

Callers 3

TestEmptyIPNetFunction · 0.80
TestIPNetDefaultFunction · 0.80
TestIPNetWithDefaultFunction · 0.80

Calls 1

getFlagTypeMethod · 0.95

Tested by 3

TestEmptyIPNetFunction · 0.64
TestIPNetDefaultFunction · 0.64
TestIPNetWithDefaultFunction · 0.64