From 7406180012d828f536112c9bffb7d3edd9ea5c7e Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Wed, 2 Jun 2021 14:55:34 -0400 Subject: [PATCH] fmt: split package documentation into more sections The package-level documentation on fmt previously had only two formal sections, for printing and scanning. Because of this, the section on printing was very long, including some pseudo-sections describing particular features. This feature makes those pseudo-sections into proper sections, both to improve readability and so that those sections have hyperlinks on documentation sites. Fixes #46522 Change-Id: I38b7bc3447610faca446051da235edcbbd063f61 Reviewed-on: https://go-review.googlesource.com/c/go/+/324349 Reviewed-by: Rob Pike Reviewed-by: Dmitri Shuralyov Run-TryBot: Dmitri Shuralyov TryBot-Result: Go Bot Trust: Tobias Klauser --- src/fmt/doc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fmt/doc.go b/src/fmt/doc.go index d05ee519c3d..c584cc9465e 100644 --- a/src/fmt/doc.go +++ b/src/fmt/doc.go @@ -189,7 +189,7 @@ When printing a struct, fmt cannot and therefore does not invoke formatting methods such as Error or String on unexported fields. - Explicit argument indexes: + Explicit argument indexes In Printf, Sprintf, and Fprintf, the default behavior is for each formatting verb to format successive arguments passed in the call. @@ -211,7 +211,7 @@ fmt.Sprintf("%d %d %#[1]x %#x", 16, 17) will yield "16 17 0x10 0x11". - Format errors: + Format errors If an invalid argument is given for a verb, such as providing a string to %d, the generated string will contain a