Esempio n. 1
0
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Ztype) UnmarshalMsg(bts []byte) (o []byte, err error) {
	{
		var ztaf int32
		ztaf, bts, err = msgp.ReadInt32Bytes(bts)
		(*z) = Ztype(ztaf)
	}
	if err != nil {
		return
	}
	o = bts
	return
}
Esempio n. 2
0
// UnmarshalMsg implements msgp.Unmarshaler
func (z *FieldT) UnmarshalMsg(bts []byte) (o []byte, err error) {
	var field []byte
	_ = field
	var zwht uint32
	zwht, bts, err = msgp.ReadMapHeaderBytes(bts)
	if err != nil {
		return
	}
	for zwht > 0 {
		zwht--
		field, bts, err = msgp.ReadMapKeyZC(bts)
		if err != nil {
			return
		}
		switch msgp.UnsafeString(field) {
		case "FieldId":
			z.FieldId, bts, err = msgp.ReadInt64Bytes(bts)
			if err != nil {
				return
			}
		case "Name":
			z.Name, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				return
			}
		case "Ztyp":
			{
				var zhct int32
				zhct, bts, err = msgp.ReadInt32Bytes(bts)
				z.Ztyp = Ztype(zhct)
			}
			if err != nil {
				return
			}
		case "IsVarArg":
			z.IsVarArg, bts, err = msgp.ReadBoolBytes(bts)
			if err != nil {
				return
			}
		case "Tags":
			var zcua uint32
			zcua, bts, err = msgp.ReadMapHeaderBytes(bts)
			if err != nil {
				return
			}
			if z.Tags == nil && zcua > 0 {
				z.Tags = make(map[string]string, zcua)
			} else if len(z.Tags) > 0 {
				for key, _ := range z.Tags {
					delete(z.Tags, key)
				}
			}
			for zcua > 0 {
				var zxvk string
				var zbzg string
				zcua--
				zxvk, bts, err = msgp.ReadStringBytes(bts)
				if err != nil {
					return
				}
				zbzg, bts, err = msgp.ReadStringBytes(bts)
				if err != nil {
					return
				}
				z.Tags[zxvk] = zbzg
			}
		case "Deprecated":
			z.Deprecated, bts, err = msgp.ReadBoolBytes(bts)
			if err != nil {
				return
			}
		case "Comment":
			z.Comment, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				return
			}
		default:
			bts, err = msgp.Skip(bts)
			if err != nil {
				return
			}
		}
	}
	o = bts
	return
}