(val string)
| 1328 | } |
| 1329 | |
| 1330 | func readAsCSV(val string) ([]string, error) { |
| 1331 | if val == "" { |
| 1332 | return []string{}, nil |
| 1333 | } |
| 1334 | stringReader := strings.NewReader(val) |
| 1335 | csvReader := csv.NewReader(stringReader) |
| 1336 | return csvReader.Read() |
| 1337 | } |
| 1338 | |
| 1339 | // mostly copied from pflag's implementation of this operation here https://github.com/spf13/pflag/blob/master/string_to_string.go#L79 |
| 1340 | // alterations are: errors are swallowed, map[string]any is returned in order to enable cast.ToStringMap. |