Пример #1
0
func (p *LogArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if p.Messages != nil {
		if err := oprot.WriteFieldBegin("messages", thrift.LIST, 1); err != nil {
			return fmt.Errorf("%T write field begin error 1:messages: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Messages)); err != nil {
			return fmt.Errorf("error writing list begin: %s")
		}
		for _, v := range p.Messages {
			if err := v.Write(oprot); err != nil {
				return fmt.Errorf("%T error writing struct: %s", v)
			}
		}
		if err := oprot.WriteListEnd(); err != nil {
			return fmt.Errorf("error writing list end: %s")
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 1:messages: %s", p, err)
		}
	}
	return err
}