示例#1
0
// DecodeMsg implements msgp.Decodable
func (z *Ztype) DecodeMsg(dc *msgp.Reader) (err error) {
	{
		var zgmo int32
		zgmo, err = dc.ReadInt32()
		(*z) = Ztype(zgmo)
	}
	if err != nil {
		return
	}
	return
}
示例#2
0
// DecodeMsg implements msgp.Decodable
func (z *FieldT) DecodeMsg(dc *msgp.Reader) (err error) {
	var field []byte
	_ = field
	var zbai uint32
	zbai, err = dc.ReadMapHeader()
	if err != nil {
		return
	}
	for zbai > 0 {
		zbai--
		field, err = dc.ReadMapKeyPtr()
		if err != nil {
			return
		}
		switch msgp.UnsafeString(field) {
		case "FieldId":
			z.FieldId, err = dc.ReadInt64()
			if err != nil {
				return
			}
		case "Name":
			z.Name, err = dc.ReadString()
			if err != nil {
				return
			}
		case "Ztyp":
			{
				var zcmr int32
				zcmr, err = dc.ReadInt32()
				z.Ztyp = Ztype(zcmr)
			}
			if err != nil {
				return
			}
		case "IsVarArg":
			z.IsVarArg, err = dc.ReadBool()
			if err != nil {
				return
			}
		case "Tags":
			var zajw uint32
			zajw, err = dc.ReadMapHeader()
			if err != nil {
				return
			}
			if z.Tags == nil && zajw > 0 {
				z.Tags = make(map[string]string, zajw)
			} else if len(z.Tags) > 0 {
				for key, _ := range z.Tags {
					delete(z.Tags, key)
				}
			}
			for zajw > 0 {
				zajw--
				var zxvk string
				var zbzg string
				zxvk, err = dc.ReadString()
				if err != nil {
					return
				}
				zbzg, err = dc.ReadString()
				if err != nil {
					return
				}
				z.Tags[zxvk] = zbzg
			}
		case "Deprecated":
			z.Deprecated, err = dc.ReadBool()
			if err != nil {
				return
			}
		case "Comment":
			z.Comment, err = dc.ReadString()
			if err != nil {
				return
			}
		default:
			err = dc.Skip()
			if err != nil {
				return
			}
		}
	}
	return
}