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

Method AppendStrings

internal/cbor/string.go:6–19  ·  view source on GitHub ↗

AppendStrings encodes and adds an array of strings to the dst byte array.

(dst []byte, vals []string)

Source from the content-addressed store, hash-verified

4
5// AppendStrings encodes and adds an array of strings to the dst byte array.
6func (e Encoder) AppendStrings(dst []byte, vals []string) []byte {
7 major := majorTypeArray
8 l := len(vals)
9 if l <= additionalMax {
10 lb := byte(l)
11 dst = append(dst, major|lb)
12 } else {
13 dst = appendCborTypePrefix(dst, major, uint64(l))
14 }
15 for _, v := range vals {
16 dst = e.AppendString(dst, v)
17 }
18 return dst
19}
20
21// AppendString encodes and adds a string to the dst byte array.
22func (Encoder) AppendString(dst []byte, s string) []byte {

Callers

nothing calls this directly

Calls 2

AppendStringMethod · 0.95
appendCborTypePrefixFunction · 0.85

Tested by

no test coverage detected