]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.14] doc/go1.14: document the change to json.Number decoding
authorDaniel Martí <mvdan@mvdan.cc>
Thu, 20 Feb 2020 20:44:18 +0000 (20:44 +0000)
committerDmitri Shuralyov <dmitshur@golang.org>
Fri, 21 Feb 2020 21:25:39 +0000 (21:25 +0000)
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 <bcmills@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/220367
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

doc/go1.14.html

index f83b365704d2288e6caabdb44d471333da5ee7a4..6355337a83ee91dcc428b982d5dc633f236a1bce 100644 (file)
@@ -582,6 +582,13 @@ appropriately.)
       was never a documented feature. For proper escaping, see <a
       href="/pkg/encoding/json/#HTMLEscape"><code>HTMLEscape</code></a>.
     </p>
+
+    <p><!-- CL 195045 -->
+      <a href="/pkg/encoding/json/#Number"><code>Number</code></a> no longer
+      accepts invalid numbers, to follow the documented behavior more closely.
+      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>
   </dd>
 </dl><!-- encoding/json -->