// Uvarint decodes a uint64 from buf and returns that value and the
// number of bytes read (> 0). If an error occurred, the value is 0
// and the number of bytes n is <= 0 meaning:
-//
-// n == 0: buf too small
-// n < 0: value larger than 64 bits (overflow)
-// and -n is the number of bytes read
+// - n == 0: buf too small;
+// - n < 0: value larger than 64 bits (overflow) and -n is the number of
+// bytes read.
func Uvarint(buf []byte) (uint64, int) {
var x uint64
var s uint
// Varint decodes an int64 from buf and returns that value and the
// number of bytes read (> 0). If an error occurred, the value is 0
// and the number of bytes n is <= 0 with the following meaning:
-//
-// n == 0: buf too small
-// n < 0: value larger than 64 bits (overflow)
-// and -n is the number of bytes read
+// - n == 0: buf too small;
+// - n < 0: value larger than 64 bits (overflow)
+// and -n is the number of bytes read.
func Varint(buf []byte) (int64, int) {
ux, n := Uvarint(buf) // ok to continue in presence of error
x := int64(ux >> 1)