aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/json/jsontext
diff options
context:
space:
mode:
Diffstat (limited to 'src/encoding/json/jsontext')
-rw-r--r--src/encoding/json/jsontext/decode.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/encoding/json/jsontext/decode.go b/src/encoding/json/jsontext/decode.go
index f505de4468..511832f2ae 100644
--- a/src/encoding/json/jsontext/decode.go
+++ b/src/encoding/json/jsontext/decode.go
@@ -792,6 +792,12 @@ func (d *decoderState) CheckNextValue(last bool) error {
return nil
}
+// AtEOF reports whether the decoder is at EOF.
+func (d *decoderState) AtEOF() bool {
+ _, err := d.consumeWhitespace(d.prevEnd)
+ return err == io.ErrUnexpectedEOF
+}
+
// CheckEOF verifies that the input has no more data.
func (d *decoderState) CheckEOF() error {
return d.checkEOF(d.prevEnd)