Append appends val to dst as a tagged value and returns the extended buffer.
(dst Bytes, val []byte)
| 39 | // Append appends val to dst as a tagged value and returns the |
| 40 | // extended buffer. |
| 41 | func Append(dst Bytes, val []byte) Bytes { |
| 42 | if val == nil { |
| 43 | return binary.AppendUvarint(dst, tagNull) |
| 44 | } |
| 45 | dst = binary.AppendUvarint(dst, toTag(len(val))) |
| 46 | return append(dst, val...) |
| 47 | } |
| 48 | |
| 49 | // SizeOfUvarint returns the number of bytes required by binary.AppendUvarint to |
| 50 | // represent u64. |