func parseInt64Bytes(bts []byte) (int64, []byte, error) {
	if msgp.IsNil(bts) {
		bts, err := msgp.ReadNilBytes(bts)
		return 0, bts, err
	}
	// read the generic representation type without decoding
	t := msgp.NextType(bts)

	var (
		i   int64
		u   uint64
		err error
	)
	switch t {
	case msgp.IntType:
		i, bts, err = msgp.ReadInt64Bytes(bts)
		if err != nil {
			return 0, bts, err
		}
		return i, bts, nil
	case msgp.UintType:
		u, bts, err = msgp.ReadUint64Bytes(bts)
		if err != nil {
			return 0, bts, err
		}

		// force-cast
		i, ok := castInt64(u)
		if !ok {
			return 0, bts, errors.New("found uint64, overflows int64")
		}
		return i, bts, nil
	default:
		return 0, bts, msgp.TypeError{Encoded: t, Method: msgp.IntType}
	}
}
// parseInt64Bytes parses an int64 even if the sent value is an uint64;
// this is required because the encoding library could remove bytes from the encoded
// payload to reduce the size, if they're not needed.
parseInt64Bytes parses an int64 even if the sent value is an uint64;
this is required because the encoding library could remove bytes from the encoded
payload to reduce the size, if they're not needed.
// parseInt64Bytes parses an int64 even if the sent value is an uint64 ; // this is required because the encoding library could remove bytes from the encoded // payload to reduce the size if they ' re not needed .
func parseInt64Bytes(bts []byte) (int64, []byte, error) {
	if msgp.IsNil(bts) {
		bts, err := msgp.ReadNilBytes(bts)
		return 0, bts, err
	}
	t := msgp.NextType(bts)
	var (
		i   int64
		u   uint64
		err error
	)
	switch t {
	case msgp.IntType:
		i, bts, err = msgp.ReadInt64Bytes(bts)
		if err != nil {
			return 0, bts, err
		}
		return i, bts, nil
	case msgp.UintType:
		u, bts, err = msgp.ReadUint64Bytes(bts)
		if err != nil {
			return 0, bts, err
		}
		i, ok := castInt64(u)
		if !ok {
			return 0, bts, errors.New("found uint64, overflows int64")
		}
		return i, bts, nil
	default:
		return 0, bts, msgp.TypeError{Encoded: t, Method: msgp.IntType}
	}
}
func parseInt64Bytes ( bts [ ] byte ) ( int64 , [ ] byte , error ) { if msgp . IsNil ( bts ) { bts , err := msgp . ReadNilBytes ( bts ) return 0 , bts , err } t := msgp . NextType ( bts ) var ( i int64 u uint64 err error ) switch t { case msgp . IntType : i , bts , err = msgp . ReadInt64Bytes ( bts ) if err != nil { return 0 , bts , err } return i , bts , nil case msgp . UintType : u , bts , err = msgp . ReadUint64Bytes ( bts ) if err != nil { return 0 , bts , err } i , ok := castInt64 ( u ) if ! ok { return 0 , bts , errors . New ( " " ) } return i , bts , nil default : return 0 , bts , msgp . TypeError { Encoded : t , Method : msgp . IntType } } }
parseInt64Bytes parses an int64 even if the sent value is an uint64;
this is required because the encoding library could remove bytes from the encoded
payload to reduce the size, if they're not needed.
parseInt64Bytes parses an int64 even if the sent value is an uint64 ; this is required because the encoding library could remove bytes from the encoded payload to reduce the size if they ' re not needed .
// read the generic representation type without decoding // force-cast