You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using bytes.Buffer to construct network protocol buffers (not to be confused with
google protobuf), it would be useful to have functions for writing and reading integer
values, like
- ReadInt/64
- WriteInt/64
thus avoiding the bitshift boilerplate
var i int64 = 0x1234567890abcdef
var b = []byte{
byte(i >> 56 & 0xFF),
byte(i >> 48 & 0xFF),
byte(i >> 40 & 0xFF),
byte(i >> 32 & 0xFF),
byte(i >> 24 & 0xFF),
byte(i >> 16 & 0xFF),
byte(i >> 8 & 0xFF),
byte(i & 0xFF),
}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: