(expected Type)
| 69 | } |
| 70 | |
| 71 | func (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 | |
| 82 | func (d *Decoder) DecodeUint() (uint64, error) { |
| 83 | return d.decodeOfType(TypePosInt) |
no test coverage detected