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

Function createS2I64Flag

string_to_int64_test.go:26–39  ·  view source on GitHub ↗
(vals map[string]int64)

Source from the content-addressed store, hash-verified

24}
25
26func createS2I64Flag(vals map[string]int64) string {
27 var buf bytes.Buffer
28 i := 0
29 for k, v := range vals {
30 if i > 0 {
31 buf.WriteRune(',')
32 }
33 buf.WriteString(k)
34 buf.WriteRune('=')
35 buf.WriteString(strconv.FormatInt(v, 10))
36 i++
37 }
38 return buf.String()
39}
40
41func TestEmptyS2I64(t *testing.T) {
42 var s2i map[string]int64

Callers 2

TestS2I64Function · 0.85
TestS2I64WithDefaultFunction · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected