MCPcopy
hub / github.com/spf13/viper / readAsCSV

Function readAsCSV

viper.go:1330–1337  ·  view source on GitHub ↗
(val string)

Source from the content-addressed store, hash-verified

1328}
1329
1330func 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.

Callers 1

findMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected