func parseInt32Bytes(bts []byte) (int32, []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   int32
		u   uint32
		err error
	)
	switch t {
	case msgp.IntType:
		i, bts, err = msgp.ReadInt32Bytes(bts)
		if err != nil {
			return 0, bts, err
		}
		return i, bts, nil
	case msgp.UintType:
		u, bts, err = msgp.ReadUint32Bytes(bts)
		if err != nil {
			return 0, bts, err
		}

		// force-cast
		i, ok := castInt32(u)
		if !ok {
			return 0, bts, errors.New("found uint32, overflows int32")
		}
		return i, bts, nil
	default:
		return 0, bts, msgp.TypeError{Encoded: t, Method: msgp.IntType}
	}
}
// parseInt32Bytes parses an int32 even if the sent value is an uint32;
// this is required because the encoding library could remove bytes from the encoded
// payload to reduce the size, if they're not needed.
parseInt32Bytes parses an int32 even if the sent value is an uint32;
this is required because the encoding library could remove bytes from the encoded
payload to reduce the size, if they're not needed.
// parseInt32Bytes parses an int32 even if the sent value is an uint32 ; // this is required because the encoding library could remove bytes from the encoded // payload to reduce the size if they ' re not needed .
func parseInt32Bytes(bts []byte) (int32, []byte, error) {
	if msgp.IsNil(bts) {
		bts, err := msgp.ReadNilBytes(bts)
		return 0, bts, err
	}
	t := msgp.NextType(bts)
	var (
		i   int32
		u   uint32
		err error
	)
	switch t {
	case msgp.IntType:
		i, bts, err = msgp.ReadInt32Bytes(bts)
		if err != nil {
			return 0, bts, err
		}
		return i, bts, nil
	case msgp.UintType:
		u, bts, err = msgp.ReadUint32Bytes(bts)
		if err != nil {
			return 0, bts, err
		}
		i, ok := castInt32(u)
		if !ok {
			return 0, bts, errors.New("found uint32, overflows int32")
		}
		return i, bts, nil
	default:
		return 0, bts, msgp.TypeError{Encoded: t, Method: msgp.IntType}
	}
}
func parseInt32Bytes ( bts [ ] byte ) ( int32 , [ ] byte , error ) { if msgp . IsNil ( bts ) { bts , err := msgp . ReadNilBytes ( bts ) return 0 , bts , err } t := msgp . NextType ( bts ) var ( i int32 u uint32 err error ) switch t { case msgp . IntType : i , bts , err = msgp . ReadInt32Bytes ( bts ) if err != nil { return 0 , bts , err } return i , bts , nil case msgp . UintType : u , bts , err = msgp . ReadUint32Bytes ( bts ) if err != nil { return 0 , bts , err } i , ok := castInt32 ( u ) if ! ok { return 0 , bts , errors . New ( " " ) } return i , bts , nil default : return 0 , bts , msgp . TypeError { Encoded : t , Method : msgp . IntType } } }
parseInt32Bytes parses an int32 even if the sent value is an uint32;
this is required because the encoding library could remove bytes from the encoded
payload to reduce the size, if they're not needed.
parseInt32Bytes parses an int32 even if the sent value is an uint32 ; 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