(buf []byte, s string)
| 779 | } |
| 780 | |
| 781 | func msgpackWriteString(buf []byte, s string) []byte { |
| 782 | n := len(s) |
| 783 | if n <= 0x1f { |
| 784 | buf = append(buf, byte(0xa0|n)) |
| 785 | } else if n <= 0xff { |
| 786 | buf = append(buf, 0xd9, byte(n)) |
| 787 | } else if n <= 0xffff { |
| 788 | buf = append(buf, 0xda, byte(n>>8), byte(n)) |
| 789 | } else { |
| 790 | buf = append(buf, 0xdb, byte(n>>24), byte(n>>16), byte(n>>8), byte(n)) |
| 791 | } |
| 792 | return append(buf, s...) |
| 793 | } |
| 794 | |
| 795 | func msgpackWriteBool(buf []byte, value bool) []byte { |
| 796 | if value { |
no test coverage detected