MCPcopy Index your code
hub / github.com/segmentio/encoding / decodeInt8

Method decodeInt8

json/decode.go:63–79  ·  view source on GitHub ↗
(b []byte, p unsafe.Pointer)

Source from the content-addressed store, hash-verified

61}
62
63func (d decoder) decodeInt8(b []byte, p unsafe.Pointer) ([]byte, error) {
64 if hasNullPrefix(b) {
65 return b[4:], nil
66 }
67
68 v, r, err := d.parseInt(b, int8Type)
69 if err != nil {
70 return r, err
71 }
72
73 if v < math.MinInt8 || v > math.MaxInt8 {
74 return r, unmarshalOverflow(b[:len(b)-len(r)], int8Type)
75 }
76
77 *(*int8)(p) = int8(v)
78 return r, nil
79}
80
81func (d decoder) decodeInt16(b []byte, p unsafe.Pointer) ([]byte, error) {
82 if hasNullPrefix(b) {

Callers

nothing calls this directly

Calls 3

parseIntMethod · 0.95
hasNullPrefixFunction · 0.85
unmarshalOverflowFunction · 0.85

Tested by

no test coverage detected