code: func ReadVarInt64(r io.Reader) (int64, error) {
  	var result int64
  	var shift uint64
  	size := uint64(32)
  	buf := make([]byte, 1)
  	for {
  		if _, err := r.Read(buf); err != nil {
  			return 0, err
  		}
  		v := int64(buf[0])
  		result |= (v & 0x7F) << shift
  		shift += 7
  		if v&0x80 == 0 {
  			if (shift < size) && (v&0x40 != 0) {
  				result |= (^0 << shift)
  			}
  			return result, nil
  		}
  	}
  }
docs: // ReadVarInt64 tries to read a int64 from r.