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

Function writeAsCSV

string_slice.go:31–40  ·  view source on GitHub ↗
(vals []string)

Source from the content-addressed store, hash-verified

29}
30
31func writeAsCSV(vals []string) (string, error) {
32 b := &bytes.Buffer{}
33 w := csv.NewWriter(b)
34 err := w.Write(vals)
35 if err != nil {
36 return "", err
37 }
38 w.Flush()
39 return strings.TrimSuffix(b.String(), "\n"), nil
40}
41
42func (s *stringSliceValue) Set(val string) error {
43 v, err := readAsCSV(val)

Callers 5

StringMethod · 0.85
StringMethod · 0.85
StringMethod · 0.85
StringMethod · 0.85
StringMethod · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected