// MarshalMsg implements the msgp.Marshaler interface
func (z *A) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())

	o = msgp.AppendMapHeader(o, 6)

	o = msgp.AppendString(o, "Name")

	o = msgp.AppendString(o, z.Name)

	o = msgp.AppendString(o, "BirthDay")

	o = msgp.AppendTime(o, z.BirthDay)

	o = msgp.AppendString(o, "Phone")

	o = msgp.AppendString(o, z.Phone)

	o = msgp.AppendString(o, "Siblings")

	o = msgp.AppendInt(o, z.Siblings)

	o = msgp.AppendString(o, "Spouse")

	o = msgp.AppendBool(o, z.Spouse)

	o = msgp.AppendString(o, "Money")

	o = msgp.AppendFloat64(o, z.Money)

	return
}
示例#2
0
// MarshalMsg implements the msgp.Marshaler interface
func (z *MsgPackSample) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())

	o = msgp.AppendMapHeader(o, 3)

	o = msgp.AppendString(o, "Name")

	o = msgp.AppendString(o, z.Name)

	o = msgp.AppendString(o, "Num")

	o = msgp.AppendInt(o, z.Num)

	o = msgp.AppendString(o, "Message")

	o = msgp.AppendString(o, z.Message)

	return
}