mirror of
https://github.com/golang/go.git
synced 2025-11-08 04:31:01 +00:00
encoding/json: escape output from Marshalers.
Fixes #3127. R=rsc, r CC=golang-dev https://golang.org/cl/5707054
This commit is contained in:
parent
ed238ca4e5
commit
99e45e49b7
3 changed files with 33 additions and 1 deletions
|
|
@ -260,7 +260,7 @@ func (e *encodeState) reflectValueQuoted(v reflect.Value, quoted bool) {
|
|||
b, err := m.MarshalJSON()
|
||||
if err == nil {
|
||||
// copy JSON into buffer, checking validity.
|
||||
err = Compact(&e.Buffer, b)
|
||||
err = compact(&e.Buffer, b, true)
|
||||
}
|
||||
if err != nil {
|
||||
e.error(&MarshalerError{v.Type(), err})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue