Skip to content

Commit 60fdbce

Browse files
ToastChengcagedmantis
authored andcommitted
[release-branch.go1.15] doc/go1.14: document json.Umarshal map key support of TextUnmarshaler
Document that json.Unmarshal supports map keys whose underlying types implement encoding.TextUnmarshaler. Updates #38801. Fixes #41178. Change-Id: Icb9414e9067517531ba0da910bd4a2bb3daace65 Reviewed-on: https://go-review.googlesource.com/c/go/+/237857 Reviewed-by: Daniel Martí <[email protected]> Run-TryBot: Daniel Martí <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> (cherry picked from commit 47b4509) Reviewed-on: https://go-review.googlesource.com/c/go/+/252618 Run-TryBot: Dmitri Shuralyov <[email protected]> Reviewed-by: Carlos Amedee <[email protected]>
1 parent a269e5f commit 60fdbce

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/go1.14.html

+6
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,12 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
609609
If a program needs to accept invalid numbers like the empty string,
610610
consider wrapping the type with <a href="/pkg/encoding/json/#Unmarshaler"><code>Unmarshaler</code></a>.
611611
</p>
612+
613+
<p><!-- CL 200237 -->
614+
<a href="/pkg/encoding/json/#Unmarshal"><code>Unmarshal</code></a>
615+
can now support map keys with string underlying type which implement
616+
<a href="/pkg/encoding/#TextUnmarshaler"><code>encoding.TextUnmarshaler</code></a>.
617+
</p>
612618
</dd>
613619
</dl><!-- encoding/json -->
614620

0 commit comments

Comments
 (0)