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

Method ReadBytes

internal/decoder/decoder.go:80–86  ·  view source on GitHub ↗

ReadBytes reads the value pointed by the decoder as bytes. Returns an error if the database is malformed or if the pointed value is not bytes.

()

Source from the content-addressed store, hash-verified

78//
79// Returns an error if the database is malformed or if the pointed value is not bytes.
80func (d *Decoder) ReadBytes() ([]byte, error) {
81 val, err := d.readBytes(KindBytes)
82 if err != nil {
83 return nil, d.wrapError(err)
84 }
85 return val, nil
86}
87
88// ReadFloat32 reads the value pointed by the decoder as a float32.
89//

Callers 2

TestBoundsCheckingFunction · 0.95
TestDecodeByteFunction · 0.80

Calls 2

readBytesMethod · 0.95
wrapErrorMethod · 0.95

Tested by 2

TestBoundsCheckingFunction · 0.76
TestDecodeByteFunction · 0.64