Skip to content

Commit

Permalink
Document that readBuf.int16() is unsigned
Browse files Browse the repository at this point in the history
It might make sense to rename it to uint16, but seeing that we're never
interested in signed 16-bit integers, it seems unnecessary.
  • Loading branch information
markottt committed Jul 23, 2015
1 parent 89d2f24 commit 0dad96c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions buf.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func (b *readBuf) oid() (n oid.Oid) {
return
}

// N.B: this is actually an unsigned 16-bit integer, unlike int32
func (b *readBuf) int16() (n int) {
n = int(binary.BigEndian.Uint16(*b))
*b = (*b)[2:]
Expand Down

0 comments on commit 0dad96c

Please sign in to comment.