String defines a "native" format for this net.IP slice flag value.
()
| 61 | |
| 62 | // String defines a "native" format for this net.IP slice flag value. |
| 63 | func (s *ipSliceValue) String() string { |
| 64 | |
| 65 | ipStrSlice := make([]string, len(*s.value)) |
| 66 | for i, ip := range *s.value { |
| 67 | ipStrSlice[i] = ip.String() |
| 68 | } |
| 69 | |
| 70 | out, _ := writeAsCSV(ipStrSlice) |
| 71 | |
| 72 | return "[" + out + "]" |
| 73 | } |
| 74 | |
| 75 | func (s *ipSliceValue) fromString(val string) (net.IP, error) { |
| 76 | return net.ParseIP(strings.TrimSpace(val)), nil |
nothing calls this directly
no test coverage detected