MCPcopy
hub / github.com/rs/zerolog / AppendBools

Method AppendBools

internal/json/types.go:57–70  ·  view source on GitHub ↗

AppendBools encodes the input bools to json and appends the encoded string list to the input byte slice.

(dst []byte, vals []bool)

Source from the content-addressed store, hash-verified

55// AppendBools encodes the input bools to json and
56// appends the encoded string list to the input byte slice.
57func (Encoder) AppendBools(dst []byte, vals []bool) []byte {
58 if len(vals) == 0 {
59 return append(dst, '[', ']')
60 }
61 dst = append(dst, '[')
62 dst = strconv.AppendBool(dst, vals[0])
63 if len(vals) > 1 {
64 for _, val := range vals[1:] {
65 dst = strconv.AppendBool(append(dst, ','), val)
66 }
67 }
68 dst = append(dst, ']')
69 return dst
70}
71
72// AppendInt converts the input int to a string and
73// appends the encoded string to the input byte slice.

Callers

nothing calls this directly

Calls 1

AppendBoolMethod · 0.65

Tested by

no test coverage detected