Commit 4e01c132 authored by Augusto Roman's avatar Augusto Roman Committed by Andrew Gerrand

doc: correct release notes for non-string map keys in encoding/json

The original draft mentioned support for json.Marshaler, but that's
not the case.  JSON supports only string keys (not arbitrary JSON)
so only encoding.TextMarshaller is supported.

Change-Id: I7788fc23ac357da88e92aa0ca17b513260840cee
Reviewed-on: https://go-review.googlesource.com/23529Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
parent 17396575
...@@ -664,23 +664,15 @@ maps using keys with string types. ...@@ -664,23 +664,15 @@ maps using keys with string types.
Go 1.7 adds support for maps using keys with integer types: Go 1.7 adds support for maps using keys with integer types:
the encoding uses a quoted decimal representation as the JSON key. the encoding uses a quoted decimal representation as the JSON key.
Go 1.7 also adds support for encoding maps using non-string keys that implement Go 1.7 also adds support for encoding maps using non-string keys that implement
<code>MarshalJSON</code> the <code>MarshalText</code>
(see
<a href="/pkg/encoding/json/#Marshaler"><code>Marshaler</code></a>)
or
<code>MarshalText</code>
(see (see
<a href="/pkg/encoding/#TextMarshaler"><code>encoding.TextMarshaler</code></a>) <a href="/pkg/encoding/#TextMarshaler"><code>encoding.TextMarshaler</code></a>)
methods, method,
as well as support for decoding maps using non-string keys that implement as well as support for decoding maps using non-string keys that implement
<code>UnmarshalJSON</code> the <code>UnmarshalText</code>
(see
<a href="/pkg/encoding/json/#Unmarshaler"><code>Unmarshaler</code></a>)
or
<code>UnmarshalText</code>
(see (see
<a href="/pkg/encoding/#TextUnmarshaler"><code>encoding.TextUnmarshaler</code></a>) <a href="/pkg/encoding/#TextUnmarshaler"><code>encoding.TextUnmarshaler</code></a>)
methods. method.
These methods are ignored for keys with string types in order to preserve These methods are ignored for keys with string types in order to preserve
the encoding and decoding used in earlier versions of Go. the encoding and decoding used in earlier versions of Go.
</p> </p>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment