Skip to content

Commit 4601a45

Browse files
authored
Add method to get how many tokenizer bytes are remaining (#126)
1 parent a1e4c6b commit 4601a45

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

json/token.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,11 @@ func (t *Tokenizer) String() []byte {
302302
return s
303303
}
304304

305+
// Remaining returns the number of bytes left to parse.
306+
func (t *Tokenizer) Remaining() int {
307+
return len(t.json)
308+
}
309+
305310
// RawValue represents a raw json value, it is intended to carry null, true,
306311
// false, number, and string values only.
307312
type RawValue []byte

0 commit comments

Comments
 (0)