MCPcopy Create free account
hub / github.com/WICG/webpackage / decodeOfType

Method decodeOfType

go/internal/cbor/decoder.go:71–80  ·  view source on GitHub ↗
(expected Type)

Source from the content-addressed store, hash-verified

69}
70
71func (d *Decoder) decodeOfType(expected Type) (uint64, error) {
72 t, n, err := d.decodeTypedUint()
73 if err != nil {
74 return 0, err
75 }
76 if t != expected {
77 return 0, fmt.Errorf("cbor: Expected type %v, got type %v", expected, t)
78 }
79 return n, nil
80}
81
82func (d *Decoder) DecodeUint() (uint64, error) {
83 return d.decodeOfType(TypePosInt)

Callers 4

DecodeUintMethod · 0.95
DecodeArrayHeaderMethod · 0.95
DecodeMapHeaderMethod · 0.95
decodeBytesOfTypeMethod · 0.95

Calls 1

decodeTypedUintMethod · 0.95

Tested by

no test coverage detected