summaryrefslogtreecommitdiff
path: root/errors.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@datawire.io>2022-08-16 22:40:19 -0600
committerLuke Shumaker <lukeshu@datawire.io>2022-08-17 00:12:35 -0600
commite57bee02e02b7e3697d6c3cb8b75923a92100427 (patch)
treef32610f2b73fbea1f2a94e108fabca18d31d5d27 /errors.go
parent87b02577e50b76d373e3c6b921d776e39cb83346 (diff)
Add tests for decode reading too far
Diffstat (limited to 'errors.go')
-rw-r--r--errors.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/errors.go b/errors.go
index e71d79a..3978d62 100644
--- a/errors.go
+++ b/errors.go
@@ -48,6 +48,7 @@ type DecodeSyntaxError struct {
func (e *DecodeSyntaxError) Error() string {
return fmt.Sprintf("json: syntax error at input byte %v: %v", e.Offset, e.Err)
}
+func (e *DecodeSyntaxError) Unwrap() error { return e.Err }
// A *DecodeTypeError is returned from Decode if the JSON input is not
// appropriate for the given Go type.