Skip to content

Commit

Permalink
Add method to get how many tokenizer bytes are remaining (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso authored Oct 7, 2022
1 parent a1e4c6b commit 4601a45
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions json/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,11 @@ func (t *Tokenizer) String() []byte {
return s
}

// Remaining returns the number of bytes left to parse.
func (t *Tokenizer) Remaining() int {
return len(t.json)
}

// RawValue represents a raw json value, it is intended to carry null, true,
// false, number, and string values only.
type RawValue []byte
Expand Down

0 comments on commit 4601a45

Please # to comment.