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

Method String

ip_slice.go:63–73  ·  view source on GitHub ↗

String defines a "native" format for this net.IP slice flag value.

()

Source from the content-addressed store, hash-verified

61
62// String defines a "native" format for this net.IP slice flag value.
63func (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
75func (s *ipSliceValue) fromString(val string) (net.IP, error) {
76 return net.ParseIP(strings.TrimSpace(val)), nil

Callers

nothing calls this directly

Calls 2

writeAsCSVFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected