MCPcopy Create free account
hub / github.com/oschwald/maxminddb-golang / decodeCtrlDataAndFollow

Method decodeCtrlDataAndFollow

internal/decoder/decoder.go:413–425  ·  view source on GitHub ↗
(expectedKind Kind)

Source from the content-addressed store, hash-verified

411}
412
413func (d *Decoder) decodeCtrlDataAndFollow(expectedKind Kind) (uint, uint, error) {
414 kindNum, size, dataOffset, nextOffset, err := d.resolveCtrlData(d.offset)
415 if err != nil {
416 return 0, 0, err // Don't wrap here, let caller wrap
417 }
418 if nextOffset != 0 {
419 d.setNextOffset(nextOffset)
420 }
421 if kindNum != expectedKind {
422 return 0, 0, unexpectedKindErr(expectedKind, kindNum)
423 }
424 return size, dataOffset, nil
425}
426
427// resolveCtrlData resolves at most one pointer starting at offset and returns
428// the control data for the non-pointer value. Unlike decodeCtrlData, which

Callers 12

ReadBoolMethod · 0.95
ReadStringMethod · 0.95
ReadFloat32Method · 0.95
ReadFloat64Method · 0.95
ReadInt32Method · 0.95
ReadUint16Method · 0.95
ReadUint32Method · 0.95
ReadUint64Method · 0.95
ReadUint128Method · 0.95
ReadMapMethod · 0.95
ReadSliceMethod · 0.95
readBytesMethod · 0.95

Calls 3

resolveCtrlDataMethod · 0.95
setNextOffsetMethod · 0.95
unexpectedKindErrFunction · 0.85

Tested by

no test coverage detected