fmt: fix %q verb documentation to say "rune literal" The Go specification uses the term "rune literal" (not "character literal") for single-quoted literals like 'a'. The %q verb documentation in the fmt package uses the outdated term "character literal". This change updates it to use the correct Go terminology. As noted by @adonovan in #78486, %q works with rune and byte types but not general int types (which is enforced by go vet since Go 1.26). Fixes #78486 Change-Id: I894f339d6242331f8b02df3cf3d432df41e50772 GitHub-Last-Rev: 1f65e43d3b8c1f002c3676499b229bae3a8deac6 GitHub-Pull-Request: golang/go#78521 Reviewed-on: https://go-review.googlesource.com/c/go/+/762580 Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Alan Donovan <adonovan@google.com> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Reviewed-by: Alex Putman <aputman@golang.org> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alan Donovan <adonovan@google.com>
diff --git a/src/fmt/doc.go b/src/fmt/doc.go index 49365ee..a6724e6 100644 --- a/src/fmt/doc.go +++ b/src/fmt/doc.go
@@ -43,7 +43,7 @@ %d base 10 %o base 8 %O base 8 with 0o prefix - %q a single-quoted character literal safely escaped with Go syntax. + %q a single-quoted rune literal safely escaped with Go syntax. %x base 16, with lower-case letters for a-f %X base 16, with upper-case letters for A-F %U Unicode format: U+1234; same as "U+%04X"