Example #1
0
func (x ComplexErrorParam) VDLWrite(enc vdl.Encoder) error {
	if err := enc.StartValue(__VDLType_struct_1); err != nil {
		return err
	}
	if x.Str != "" {
		if err := enc.NextFieldValueString(0, vdl.StringType, x.Str); err != nil {
			return err
		}
	}
	if x.Num != 0 {
		if err := enc.NextFieldValueInt(1, vdl.Int32Type, int64(x.Num)); err != nil {
			return err
		}
	}
	if len(x.List) != 0 {
		if err := enc.NextField(2); err != nil {
			return err
		}
		if err := __VDLWriteAnon_list_1(enc, x.List); err != nil {
			return err
		}
	}
	if err := enc.NextField(-1); err != nil {
		return err
	}
	return enc.FinishValue()
}
Example #2
0
func __VDLWriteAnon_list_1(enc vdl.Encoder, x []uint32) error {
	if err := enc.StartValue(__VDLType_list_2); err != nil {
		return err
	}
	if err := enc.SetLenHint(len(x)); err != nil {
		return err
	}
	for _, elem := range x {
		if err := enc.NextEntryValueUint(vdl.Uint32Type, uint64(elem)); err != nil {
			return err
		}
	}
	if err := enc.NextEntry(true); err != nil {
		return err
	}
	return enc.FinishValue()
}