Skip to content

Commit ae7cd5c

Browse files
committed
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. Fixes #37308. Change-Id: Id65bc70def1138d5506b694329c52250b417ec6f Reviewed-on: https://go-review.googlesource.com/c/go/+/220418 Reviewed-by: Bryan C. Mills <[email protected]>
1 parent 30e3bf2 commit ae7cd5c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/go1.14.html

+7
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)