encodeStringArray encodes a slice of strings as a msgpack array of strings. Returns the byte offset into the buffer, or noStructuredData if the slice is empty.
(strs []string, buf *[]byte)
| 742 | // encodeStringArray encodes a slice of strings as a msgpack array of strings. |
| 743 | // Returns the byte offset into the buffer, or noStructuredData if the slice is empty. |
| 744 | func encodeStringArray(strs []string, buf *[]byte) uint32 { |
| 745 | if len(strs) == 0 { |
| 746 | return noStructuredData |
| 747 | } |
| 748 | offset := uint32(len(*buf)) |
| 749 | *buf = msgpackWriteArrayHeader(*buf, len(strs)) |
| 750 | for _, s := range strs { |
| 751 | *buf = msgpackWriteString(*buf, s) |
| 752 | } |
| 753 | return offset |
| 754 | } |
| 755 | |
| 756 | // Minimal msgpack writers for the structured data section. |
| 757 |
no test coverage detected