GetIPNetSlice returns the []net.IPNet value of a flag with the given name
(name string)
| 91 | |
| 92 | // GetIPNetSlice returns the []net.IPNet value of a flag with the given name |
| 93 | func (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. |