diff options
author | Kevin Burke <kev@inburke.com> | 2020-10-19 13:29:40 -0700 |
---|---|---|
committer | Kevin Burke <kev@inburke.com> | 2020-10-21 18:50:01 +0000 |
commit | 6af088bfc66c13143c9ef46b4cf0805df77a8fbe (patch) | |
tree | 0fde5c9608b15b0511812d165856204970046af0 /src/html | |
parent | 612a363bef9ae29d190f6daa2a5a1623f78c874b (diff) | |
download | go-6af088bfc66c13143c9ef46b4cf0805df77a8fbe.tar.gz go-6af088bfc66c13143c9ef46b4cf0805df77a8fbe.zip |
encoding/json: add "json: " prefix to SyntaxError messages
The other named errors - UnmarshalTypeError, etc - in this package do
the same, so we should prepend the package prefix to error messages
for consistency.
Add a note to the release docs in case this is interpreted as
a breaking change.
Fixes #36221.
Change-Id: Ie24b532bbf9812e108c259fa377e2a6b64319ed4
Reviewed-on: https://go-review.googlesource.com/c/go/+/263619
Run-TryBot: Kevin Burke <kev@inburke.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Kevin Burke <kev@inburke.com>
Trust: Daniel Martà <mvdan@mvdan.cc>
Reviewed-by: Daniel Martà <mvdan@mvdan.cc>
Diffstat (limited to 'src/html')
-rw-r--r-- | src/html/template/escape_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/html/template/escape_test.go b/src/html/template/escape_test.go index fbc84a7592..b6031ea60a 100644 --- a/src/html/template/escape_test.go +++ b/src/html/template/escape_test.go @@ -243,7 +243,7 @@ func TestEscape(t *testing.T) { { "badMarshaler", `<button onclick='alert(1/{{.B}}in numbers)'>`, - `<button onclick='alert(1/ /* json: error calling MarshalJSON for type *template.badMarshaler: invalid character 'f' looking for beginning of object key string */null in numbers)'>`, + `<button onclick='alert(1/ /* json: error calling MarshalJSON for type *template.badMarshaler: json: invalid character 'f' looking for beginning of object key string */null in numbers)'>`, }, { "jsMarshaler", |