aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/json/v2_stream.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/encoding/json/v2_stream.go')
-rw-r--r--src/encoding/json/v2_stream.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/encoding/json/v2_stream.go b/src/encoding/json/v2_stream.go
index d58bafbfd0..ccbef6077b 100644
--- a/src/encoding/json/v2_stream.go
+++ b/src/encoding/json/v2_stream.go
@@ -68,7 +68,7 @@ func (dec *Decoder) Decode(v any) error {
b, err := dec.dec.ReadValue()
if err != nil {
dec.err = transformSyntacticError(err)
- if dec.err == errUnexpectedEnd {
+ if dec.err.Error() == errUnexpectedEnd.Error() {
// NOTE: Decode has always been inconsistent with Unmarshal
// with regard to the exact error value for truncated input.
dec.err = io.ErrUnexpectedEOF