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

Method String

bool_slice.go:62–72  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

60
61// String defines a "native" format for this boolean slice flag value.
62func (s *boolSliceValue) String() string {
63
64 boolStrSlice := make([]string, len(*s.value))
65 for i, b := range *s.value {
66 boolStrSlice[i] = strconv.FormatBool(b)
67 }
68
69 out, _ := writeAsCSV(boolStrSlice)
70
71 return "[" + out + "]"
72}
73
74func (s *boolSliceValue) fromString(val string) (bool, error) {
75 return strconv.ParseBool(val)

Callers

nothing calls this directly

Calls 1

writeAsCSVFunction · 0.85

Tested by

no test coverage detected