aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/json/stream.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2016-04-10 10:16:41 -0700
committerBrad Fitzpatrick <bradfitz@golang.org>2016-10-26 21:03:00 +0000
commit1625da24106b610f89ff7a67a11581df95f8e234 (patch)
tree4d83320fd39a407c7cd8a4c28f62a9003b2b494f /src/encoding/json/stream.go
parent587b80322c6ce34ab115d7a837a56d7450aa913d (diff)
downloadgo-1625da24106b610f89ff7a67a11581df95f8e234.tar.xz
encoding/json: marshal the RawMessage value type the same as its pointer type
Fixes #14493 Updates #6458 (changes its behavior) Change-Id: I851a8113fd312dae3384e989ec2b70949dc22838 Reviewed-on: https://go-review.googlesource.com/21811 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Quentin Smith <quentin@golang.org>
Diffstat (limited to 'src/encoding/json/stream.go')
-rw-r--r--src/encoding/json/stream.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/encoding/json/stream.go b/src/encoding/json/stream.go
index 87f0e57c6c..4c350fdd5e 100644
--- a/src/encoding/json/stream.go
+++ b/src/encoding/json/stream.go
@@ -246,9 +246,9 @@ func (enc *Encoder) SetEscapeHTML(on bool) {
// be used to delay JSON decoding or precompute a JSON encoding.
type RawMessage []byte
-// MarshalJSON returns *m as the JSON encoding of m.
-func (m *RawMessage) MarshalJSON() ([]byte, error) {
- return *m, nil
+// MarshalJSON returns m as the JSON encoding of m.
+func (m RawMessage) MarshalJSON() ([]byte, error) {
+ return m, nil
}
// UnmarshalJSON sets *m to a copy of data.