Example #1
0
func (p *Types) writeField8(oprot thrift.TProtocol) (err error) {
	if p.IsSetSetValue() {
		if err := oprot.WriteFieldBegin("set_value", thrift.SET, 8); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:set_value: ", p), err)
		}
		if err := oprot.WriteSetBegin(thrift.STRING, len(p.SetValue)); err != nil {
			return thrift.PrependError("error writing set begin: ", err)
		}
		for v, _ := range p.SetValue {
			if err := oprot.WriteString(string(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
		}
		if err := oprot.WriteSetEnd(); err != nil {
			return thrift.PrependError("error writing set end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 8:set_value: ", p), err)
		}
	}
	return err
}