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

Method AppendInts

internal/json/types.go:80–93  ·  view source on GitHub ↗

AppendInts encodes the input ints to json and appends the encoded string list to the input byte slice.

(dst []byte, vals []int)

Source from the content-addressed store, hash-verified

78// AppendInts encodes the input ints to json and
79// appends the encoded string list to the input byte slice.
80func (Encoder) AppendInts(dst []byte, vals []int) []byte {
81 if len(vals) == 0 {
82 return append(dst, '[', ']')
83 }
84 dst = append(dst, '[')
85 dst = strconv.AppendInt(dst, int64(vals[0]), 10)
86 if len(vals) > 1 {
87 for _, val := range vals[1:] {
88 dst = strconv.AppendInt(append(dst, ','), int64(val), 10)
89 }
90 }
91 dst = append(dst, ']')
92 return dst
93}
94
95// AppendInt8 converts the input []int8 to a string and
96// appends the encoded string to the input byte slice.

Callers

nothing calls this directly

Calls 1

AppendIntMethod · 0.65

Tested by

no test coverage detected