Skip to content

Commit b4dca64

Browse files
mvdandmitshur
authored andcommitted
[release-branch.go1.14] doc/go1.14: document the change to json.Number decoding
It might break a program if it was depending on undocumented behavior. Give a proper heads up. Updates #37308. Change-Id: Id65bc70def1138d5506b694329c52250b417ec6f Reviewed-on: https://go-review.googlesource.com/c/go/+/220418 Reviewed-by: Bryan C. Mills <[email protected]> Reviewed-on: https://go-review.googlesource.com/c/go/+/220367 Run-TryBot: Dmitri Shuralyov <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent f5293d7 commit b4dca64

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/go1.14.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,13 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
582582
was never a documented feature. For proper escaping, see <a
583583
href="/pkg/encoding/json/#HTMLEscape"><code>HTMLEscape</code></a>.
584584
</p>
585+
586+
<p><!-- CL 195045 -->
587+
<a href="/pkg/encoding/json/#Number"><code>Number</code></a> no longer
588+
accepts invalid numbers, to follow the documented behavior more closely.
589+
If a program needs to accept invalid numbers like the empty string,
590+
consider wrapping the type with <a href="/pkg/encoding/json/#Unmarshaler"><code>Unmarshaler</code></a>.
591+
</p>
585592
</dd>
586593
</dl><!-- encoding/json -->
587594

0 commit comments

Comments
 (0)