MCPcopy Create free account
hub / github.com/apache/fory / readExpectedTypeID

Method readExpectedTypeID

go/fory/reader.go:153–163  ·  view source on GitHub ↗
(expected TypeId)

Source from the content-addressed store, hash-verified

151}
152
153func (c *ReadContext) readExpectedTypeID(expected TypeId) bool {
154 actual := TypeId(c.buffer.ReadUint8(c.Err()))
155 if c.HasError() {
156 return false
157 }
158 if actual != expected {
159 c.SetError(TypeMismatchError(actual, expected))
160 return false
161 }
162 return true
163}
164
165// Inline primitive reads
166func (c *ReadContext) RawBool() bool { return c.buffer.ReadBool(c.Err()) }

Callers 15

ReadStringStringMapMethod · 0.95
ReadStringInt64MapMethod · 0.95
ReadStringInt32MapMethod · 0.95
ReadStringIntMapMethod · 0.95
ReadStringFloat64MapMethod · 0.95
ReadStringBoolMapMethod · 0.95
ReadInt32Int32MapMethod · 0.95
ReadInt64Int64MapMethod · 0.95
ReadIntIntMapMethod · 0.95
ReadMethod · 0.80
ReadMethod · 0.80
readMapRefAndTypeFunction · 0.80

Calls 6

ErrMethod · 0.95
HasErrorMethod · 0.95
SetErrorMethod · 0.95
TypeMismatchErrorFunction · 0.85
ReadUint8Method · 0.80
TypeIdEnum · 0.50

Tested by

no test coverage detected