Skip to content

Instantly share code, notes, and snippets.

@ii64
Last active August 8, 2019 02:29
Show Gist options
  • Save ii64/217654a5cefa24d6cd4190004b03e48d to your computer and use it in GitHub Desktop.
Save ii64/217654a5cefa24d6cd4190004b03e48d to your computer and use it in GitHub Desktop.
Tanya shadowing
func (c *CompactMessageService) readResponse() (r *CompactMessageResponse, e error) {
sent, e := c.proto.ReadBool()
if e != nil {
return
}
if !sent {
errorCode, e := c.proto.ReadI32()
if e != nil {
return
}
e = &CompactMessageException{sent, LineThrift.ErrorCode(errorCode)}
return
}
seqId, e := c.proto.ReadI32()
if e != nil {
return
}
msgId, e := c.proto.ReadI64()
if e != nil {
return
}
createdTime, e := c.proto.ReadI64()
if e != nil {
return
}
return &CompactMessageResponse{sent, seqId, msgId, createdTime}, nil
}
func (c *CompactMessageService) readResponse() (r *CompactMessageResponse, e error) {
sent, e := c.proto.ReadBool()
if e != nil {
return
}
if !sent {
errorCode, e := c.proto.ReadI32()
if e != nil {
return nil, e
}
e = &CompactMessageException{sent, LineThrift.ErrorCode(errorCode)}
return nil, e
}
seqId, e := c.proto.ReadI32()
if e != nil {
return
}
msgId, e := c.proto.ReadI64()
if e != nil {
return
}
createdTime, e := c.proto.ReadI64()
if e != nil {
return
}
return &CompactMessageResponse{sent, seqId, msgId, createdTime}, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment