NextTagAndBody returns the next value as a slice containing the value's undecoded tag followed by its body. NextTagAndBody panics if the next value is malformed.
()
| 39 | // undecoded tag followed by its body. NextTagAndBody panics if the next |
| 40 | // value is malformed. |
| 41 | func (i *Iter) NextTagAndBody() Bytes { |
| 42 | u64, n := binary.Uvarint(*i) |
| 43 | if n <= 0 { |
| 44 | panic(fmt.Sprintf("bad uvarint: %d", n)) |
| 45 | } |
| 46 | if !tagIsNull(u64) { |
| 47 | n += tagLength(u64) |
| 48 | } |
| 49 | val := (*i)[:n] |
| 50 | *i = (*i)[n:] |
| 51 | return Bytes(val) |
| 52 | } |
| 53 | |
| 54 | type RecordIter struct { |
| 55 | off int |
no test coverage detected