MCPcopy
hub / github.com/etcd-io/etcd / NewStringsValue

Function NewStringsValue

pkg/flags/strings.go:39–48  ·  view source on GitHub ↗

NewStringsValue implements string slice as "flag.Value" interface. Given value is to be separated by comma.

(s string)

Source from the content-addressed store, hash-verified

37// NewStringsValue implements string slice as "flag.Value" interface.
38// Given value is to be separated by comma.
39func NewStringsValue(s string) (ss *StringsValue) {
40 if s == "" {
41 return &StringsValue{}
42 }
43 ss = new(StringsValue)
44 if err := ss.Set(s); err != nil {
45 panic(fmt.Sprintf("new StringsValue should never fail: %v", err))
46 }
47 return ss
48}
49
50// StringsFromFlag returns a string slice from the flag.
51func StringsFromFlag(fs *flag.FlagSet, flagName string) []string {

Callers 1

TestStringsValueFunction · 0.85

Calls 1

SetMethod · 0.65

Tested by 1

TestStringsValueFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…