aboutsummaryrefslogtreecommitdiff
path: root/src/fmt
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2022-03-08 09:51:29 -0500
committerRuss Cox <rsc@golang.org>2022-03-16 16:28:38 +0000
commit3efc7215cbf6c7842cba0f5ebe90f72f0b6de9e1 (patch)
treeba1181553e3872c907d3035e13ba90bed135d6e0 /src/fmt
parent33e752edd3f5fa5b738730513a7c1283d8e98fa2 (diff)
downloadgo-3efc7215cbf6c7842cba0f5ebe90f72f0b6de9e1.tar.gz
go-3efc7215cbf6c7842cba0f5ebe90f72f0b6de9e1.zip
fmt, strconv: document use of Unicode replacement character in %q
Fixes #51526. Change-Id: I365a763454bd201f804df29f800416b1731b8ebc Reviewed-on: https://go-review.googlesource.com/c/go/+/390436 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Rob Pike <r@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/fmt')
-rw-r--r--src/fmt/doc.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fmt/doc.go b/src/fmt/doc.go
index f14a7a73e3..6b49deda87 100644
--- a/src/fmt/doc.go
+++ b/src/fmt/doc.go
@@ -110,6 +110,10 @@ For complex numbers, the width and precision apply to the two
components independently and the result is parenthesized, so %f applied
to 1.2+3.4i produces (1.200000+3.400000i).
+When formatting a single integer code point or a rune string (type []rune)
+with %q, invalid Unicode code points are changed to the Unicode replacement
+character, U+FFFD, as in strconv.QuoteRune.
+
Other flags:
+ always print a sign for numeric values;
guarantee ASCII-only output for %q (%+q)