本文整理匯總了Golang中github.com/apesternikov/thrift4go/lib/go/src/thrift.TProtocol.ReadI16方法的典型用法代碼示例。如果您正苦於以下問題:Golang TProtocol.ReadI16方法的具體用法?Golang TProtocol.ReadI16怎麽用?Golang TProtocol.ReadI16使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/apesternikov/thrift4go/lib/go/src/thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.ReadI16方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: readField2
func (p *Manymaps) readField2(iprot thrift.TProtocol) (err thrift.TProtocolException) {
_ktype18, _vtype19, _size17, err := iprot.ReadMapBegin()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "p.I16map", "", err)
}
_, _ = _ktype18, _vtype19
p.I16map = make(map[int16]string, _size17)
for i := 0; i < _size17; i++ {
v24, err25 := iprot.ReadI16()
if err25 != nil {
return thrift.NewTProtocolExceptionReadField(0, "_key22", "", err25)
}
_key22 := v24
v26, err27 := iprot.ReadString()
if err27 != nil {
return thrift.NewTProtocolExceptionReadField(0, "_val23", "", err27)
}
_val23 := v26
p.I16map[_key22] = _val23
}
err = iprot.ReadMapEnd()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "", "map", err)
}
return err
}
示例2: readField3
func (p *MyMethodArgs) readField3(iprot thrift.TProtocol) (err thrift.TProtocolException) {
v1121, err1122 := iprot.ReadI16()
if err1122 != nil {
return thrift.NewTProtocolExceptionReadField(3, "second", p.ThriftName(), err1122)
}
p.Second = v1121
return err
}