Skip to content

Commit

Permalink
[release-branch.go1.14] doc/go1.14: document json.Umarshal map key su…
Browse files Browse the repository at this point in the history
…pport of TextUnmarshaler

Document that json.Unmarshal supports map keys whose underlying
types implement encoding.TextUnmarshaler.

Updates #38801.
Fixes #38904.

Change-Id: Icb9414e9067517531ba0da910bd4a2bb3daace65
Reviewed-on: https://go-review.googlesource.com/c/go/+/237857
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit 47b4509)
Reviewed-on: https://go-review.googlesource.com/c/go/+/252617
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
  • Loading branch information
ToastCheng authored and cagedmantis committed Sep 2, 2020
1 parent 2cab203 commit 404635c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/go1.14.html
Expand Up @@ -609,6 +609,12 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
If a program needs to accept invalid numbers like the empty string,
consider wrapping the type with <a href="/pkg/encoding/json/#Unmarshaler"><code>Unmarshaler</code></a>.
</p>

<p><!-- CL 200237 -->
<a href="/pkg/encoding/json/#Unmarshal"><code>Unmarshal</code></a>
can now support map keys with string underlying type which implement
<a href="/pkg/encoding/#TextUnmarshaler"><code>encoding.TextUnmarshaler</code></a>.
</p>
</dd>
</dl><!-- encoding/json -->

Expand Down

0 comments on commit 404635c

Please sign in to comment.