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

Method String

ipnet_slice.go:63–72  ·  ipnet_slice.go::ipNetSliceValue.String

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

()

Source from the content-addressed store, hash-verified

61
62// String defines a "native" format for this net.IPNet slice flag value.
63func (s *ipNetSliceValue) String() string {
64
65 ipNetStrSlice := make([]string, len(*s.value))
66 for i, n := range *s.value {
67 ipNetStrSlice[i] = n.String()
68 }
69
70 out, _ := writeAsCSV(ipNetStrSlice)
71 return "[" + out + "]"
72}
73
74func ipNetSliceConv(val string) (interface{}, error) {
75 val = strings.Trim(val, "[]")

Callers

nothing calls this directly

Calls 2

writeAsCSVFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected