本文整理匯總了Golang中github.com/bcgraham/tsumtsum/external/thrift.TProtocol.WriteListEnd方法的典型用法代碼示例。如果您正苦於以下問題:Golang TProtocol.WriteListEnd方法的具體用法?Golang TProtocol.WriteListEnd怎麽用?Golang TProtocol.WriteListEnd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/bcgraham/tsumtsum/external/thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.WriteListEnd方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: writeField2
func (p *MultiGetLastReadMessageIdsArgs) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("chatIds", thrift.LIST, 2); err != nil {
return fmt.Errorf("%T write field begin error 2:chatIds: %s", p, err)
}
if err := oprot.WriteListBegin(thrift.STRING, len(p.ChatIds)); err != nil {
return fmt.Errorf("error writing list begin: %s", err)
}
for _, v := range p.ChatIds {
if err := oprot.WriteString(string(v)); err != nil {
return fmt.Errorf("%T. (0) field write error: %s", p, err)
}
}
if err := oprot.WriteListEnd(); err != nil {
return fmt.Errorf("error writing list end: %s", err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 2:chatIds: %s", p, err)
}
return err
}
示例2: writeField0
func (p *GetAllContactIdsResult) writeField0(oprot thrift.TProtocol) (err error) {
if p.IsSetSuccess() {
if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
return fmt.Errorf("%T write field begin error 0:success: %s", p, err)
}
if err := oprot.WriteListBegin(thrift.STRING, len(p.Success)); err != nil {
return fmt.Errorf("error writing list begin: %s", err)
}
for _, v := range p.Success {
if err := oprot.WriteString(string(v)); err != nil {
return fmt.Errorf("%T. (0) field write error: %s", p, err)
}
}
if err := oprot.WriteListEnd(); err != nil {
return fmt.Errorf("error writing list end: %s", err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 0:success: %s", p, err)
}
}
return err
}
示例3: writeField0
func (p *MultiGetLastReadMessageIdsResult) writeField0(oprot thrift.TProtocol) (err error) {
if p.IsSetSuccess() {
if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
return fmt.Errorf("%T write field begin error 0:success: %s", p, err)
}
if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Success)); err != nil {
return fmt.Errorf("error writing list begin: %s", err)
}
for _, v := range p.Success {
if err := v.Write(oprot); err != nil {
return fmt.Errorf("%T error writing struct: %s", v, err)
}
}
if err := oprot.WriteListEnd(); err != nil {
return fmt.Errorf("error writing list end: %s", err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 0:success: %s", p, err)
}
}
return err
}