本文整理匯總了Golang中github.com/apesternikov/thrift4go/lib/go/src/thrift.TProtocol.WriteI16方法的典型用法代碼示例。如果您正苦於以下問題:Golang TProtocol.WriteI16方法的具體用法?Golang TProtocol.WriteI16怎麽用?Golang TProtocol.WriteI16使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/apesternikov/thrift4go/lib/go/src/thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.WriteI16方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: writeField2
func (p *Manylists) writeField2(oprot thrift.TProtocol) (err thrift.TProtocolException) {
if p.I16list != nil {
if p.IsSetI16list() {
err = oprot.WriteFieldBegin("i16list", thrift.LIST, 2)
if err != nil {
return thrift.NewTProtocolExceptionWriteField(2, "i16list", p.ThriftName(), err)
}
err = oprot.WriteListBegin(thrift.I16, len(p.I16list))
if err != nil {
return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
}
for _, Iter78 := range p.I16list {
err = oprot.WriteI16(int16(Iter78))
if err != nil {
return thrift.NewTProtocolExceptionWriteField(0, "Iter78", "", err)
}
}
err = oprot.WriteListEnd()
if err != nil {
return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
}
err = oprot.WriteFieldEnd()
if err != nil {
return thrift.NewTProtocolExceptionWriteField(2, "i16list", p.ThriftName(), err)
}
}
}
return err
}
示例2: writeField3
func (p *MyMethodArgs) writeField3(oprot thrift.TProtocol) (err thrift.TProtocolException) {
err = oprot.WriteFieldBegin("second", thrift.I16, 3)
if err != nil {
return thrift.NewTProtocolExceptionWriteField(3, "second", p.ThriftName(), err)
}
err = oprot.WriteI16(int16(p.Second))
if err != nil {
return thrift.NewTProtocolExceptionWriteField(3, "second", p.ThriftName(), err)
}
err = oprot.WriteFieldEnd()
if err != nil {
return thrift.NewTProtocolExceptionWriteField(3, "second", p.ThriftName(), err)
}
return err
}