From: Emmanuel T Odeke Date: Fri, 23 Aug 2019 16:05:56 +0000 (-0600) Subject: [release-branch.go1.13] doc/go1.13: document fmt's number syntax updates X-Git-Tag: go1.13rc2~11 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=55a5beb12c3ac96eeb09bff6aadf6193cfa7214d;p=gostls13.git [release-branch.go1.13] doc/go1.13: document fmt's number syntax updates Fixes #32815 Change-Id: Ia8ac9943a920a056ba7dbc69c1c70fa188f7aca8 Reviewed-on: https://go-review.googlesource.com/c/go/+/191578 Reviewed-by: Robert Griesemer (cherry picked from commit 9e1c864afe00b3cfba3e09d7c67fc17526db464a) Reviewed-on: https://go-review.googlesource.com/c/go/+/191738 Reviewed-by: Emmanuel Odeke Run-TryBot: Andrew Bonventre TryBot-Result: Gobot Gobot --- diff --git a/doc/go1.13.html b/doc/go1.13.html index 6cee0b28e6..4120cfb24c 100644 --- a/doc/go1.13.html +++ b/doc/go1.13.html @@ -667,6 +667,24 @@ godoc
fmt
+ +

+ The printing verbs %x and %X now format floating-point and + complex numbers in hexadecimal notation, in lower-case and upper-case respectively. +

+ + +

+ The new printing verb %O formats integers in base 8, emitting the 0o prefix. +

+ + +

+ The scanner now accepts hexadecimal floating-point values, digit-separating underscores + and leading 0b and 0o prefixes. + See the Changes to the language for details. +

+

The Errorf function has a new verb, %w, whose operand must be an error. diff --git a/src/fmt/scan.go b/src/fmt/scan.go index 74ada20de7..0dab2c98f7 100644 --- a/src/fmt/scan.go +++ b/src/fmt/scan.go @@ -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) {