Remaining returns the number of bytes left to parse. The position of the tokenizer's current Value within the original byte slice can be calculated like so: end := len(b) - tok.Remaining() start := end - len(tok.Value) And slicing b[start:end] will yield the tokenizer's current Value.
()
| 311 | // |
| 312 | // And slicing b[start:end] will yield the tokenizer's current Value. |
| 313 | func (t *Tokenizer) Remaining() int { |
| 314 | return len(t.json) |
| 315 | } |
| 316 | |
| 317 | // RawValue represents a raw json value, it is intended to carry null, true, |
| 318 | // false, number, and string values only. |