NewStringsValue implements string slice as "flag.Value" interface. Given value is to be separated by comma.
(s string)
| 37 | // NewStringsValue implements string slice as "flag.Value" interface. |
| 38 | // Given value is to be separated by comma. |
| 39 | func 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. |
| 51 | func StringsFromFlag(fs *flag.FlagSet, flagName string) []string { |
searching dependent graphs…