]> Cypherpunks repositories - gostls13.git/commit
encoding/json: correct caller's name in encoding errors
authorEugene Kalinin <e.v.kalinin@gmail.com>
Fri, 28 Jun 2019 20:59:49 +0000 (23:59 +0300)
committerIan Lance Taylor <iant@golang.org>
Wed, 16 Oct 2019 22:58:08 +0000 (22:58 +0000)
commit02196d36575636a64f868ee0ffe6bb61442e7245
tree79a31755b7516b27eef4ec7e0c76bfead383633a
parent943df4f629560f5c33474dd82e2b534ea5f8653f
encoding/json: correct caller's name in encoding errors

1. Change mapencode.encode to use fmt.Error rather than MarshalerError.
MarshalerError refer to MarshalJSON, but mapencode.encode does not use that.

2. Add sourceFunc field to MarshalerError to record the name of the function
that creates the error, so that the Error method can report it correctly.

Fixes #29753

Change-Id: I186c2fac8470ae2f9e300501de3730face642230
Reviewed-on: https://go-review.googlesource.com/c/go/+/184119
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/encoding/json/encode.go
src/encoding/json/encode_test.go