(data []byte, value int64)
| 129 | } |
| 130 | |
| 131 | func AppendVarLong(data []byte, value int64) []byte { |
| 132 | var ( |
| 133 | continueBit int64 = 128 |
| 134 | segmentBits int64 = 127 |
| 135 | ) |
| 136 | for { |
| 137 | if (value & ^segmentBits) == 0 { |
| 138 | return append(data, byte(value)) |
| 139 | } |
| 140 | |
| 141 | data = append(data, byte((value&segmentBits)|continueBit)) |
| 142 | |
| 143 | value >>= 7 |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | func AppendString(data []byte, str string) []byte { |
| 148 | data = AppendVarInt(data, int32(len(str))) |
nothing calls this directly
no outgoing calls
no test coverage detected