]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.13] doc/go1.13: document fmt's number syntax updates
authorEmmanuel T Odeke <emmanuel@orijtech.com>
Fri, 23 Aug 2019 16:05:56 +0000 (10:05 -0600)
committerAndrew Bonventre <andybons@golang.org>
Sun, 25 Aug 2019 16:54:13 +0000 (16:54 +0000)
Fixes #32815

Change-Id: Ia8ac9943a920a056ba7dbc69c1c70fa188f7aca8
Reviewed-on: https://go-review.googlesource.com/c/go/+/191578
Reviewed-by: Robert Griesemer <gri@golang.org>
(cherry picked from commit 9e1c864afe00b3cfba3e09d7c67fc17526db464a)
Reviewed-on: https://go-review.googlesource.com/c/go/+/191738
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

doc/go1.13.html
src/fmt/scan.go

index 6cee0b28e60e27ab47e06b10c379c59c25901dbf..4120cfb24ccdfe774090517c6629a7bfe38fd6a4 100644 (file)
@@ -667,6 +667,24 @@ godoc
 
 <dl id="fmt"><dt><a href="/pkg/fmt/">fmt</a></dt>
   <dd>
+    <!-- CL 160245 -->
+    <p>
+      The printing verbs <code>%x</code> and <code>%X</code> now format floating-point and
+      complex numbers in hexadecimal notation, in lower-case and upper-case respectively.
+    </p>
+
+    <!-- CL 160246 -->
+    <p>
+      The new printing verb <code>%O</code> formats integers in base 8, emitting the <code>0o</code> prefix.
+    </p>
+
+    <!-- CL 160247 -->
+    <p>
+      The scanner now accepts hexadecimal floating-point values, digit-separating underscores
+      and leading <code>0b</code> and <code>0o</code> prefixes.
+      See the <a href="#language">Changes to the language</a> for details.
+    </p>
+
     <!-- CL 176998 -->
     <p>The <a href="/pkg/fmt/#Errorf"><code>Errorf</code></a> function
       has a new verb, <code>%w</code>, whose operand must be an error.
index 74ada20de7a7cf66b91996cbf0318b9aaf703853..0dab2c98f75ee72666bd829ac2f4d07d5ff923bd 100644 (file)
@@ -609,7 +609,7 @@ func (s *ss) scanRune(bitSize int) int64 {
        return r
 }
 
-// scanBasePrefix reports whether the integer begins with a bas prefix
+// scanBasePrefix reports whether the integer begins with a base prefix
 // and returns the base, digit string, and whether a zero was found.
 // It is called only if the verb is %v.
 func (s *ss) scanBasePrefix() (base int, digits string, zeroFound bool) {