AppendStrings encodes and adds an array of strings to the dst byte array.
(dst []byte, vals []string)
| 4 | |
| 5 | // AppendStrings encodes and adds an array of strings to the dst byte array. |
| 6 | func (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. |
| 22 | func (Encoder) AppendString(dst []byte, s string) []byte { |
nothing calls this directly
no test coverage detected