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

Function createS2SFlag

string_to_string_test.go:27–40  ·  view source on GitHub ↗
(vals map[string]string)

Source from the content-addressed store, hash-verified

25}
26
27func createS2SFlag(vals map[string]string) string {
28 records := make([]string, 0, len(vals)>>1)
29 for k, v := range vals {
30 records = append(records, k+"="+v)
31 }
32
33 var buf bytes.Buffer
34 w := csv.NewWriter(&buf)
35 if err := w.Write(records); err != nil {
36 panic(err)
37 }
38 w.Flush()
39 return strings.TrimSpace(buf.String())
40}
41
42func TestEmptyS2S(t *testing.T) {
43 var s2s map[string]string

Callers 2

TestS2SFunction · 0.85
TestS2SWithDefaultFunction · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected