CheckError checks if an error has occurred and returns it as a standard error This is used at strategic points for deferred error checking
()
| 144 | // CheckError checks if an error has occurred and returns it as a standard error |
| 145 | // This is used at strategic points for deferred error checking |
| 146 | func (c *ReadContext) CheckError() error { |
| 147 | if c.err.HasError() { |
| 148 | return c.TakeError() |
| 149 | } |
| 150 | return nil |
| 151 | } |
| 152 | |
| 153 | func (c *ReadContext) readExpectedTypeID(expected TypeId) bool { |
| 154 | actual := TypeId(c.buffer.ReadUint8(c.Err())) |