diff options
| author | Russ Cox <rsc@golang.org> | 2022-01-29 19:07:27 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2022-04-01 18:18:01 +0000 |
| commit | 7d87ccc860dc31c0cd60faf00720e2f30fd37efb (patch) | |
| tree | 3dc01e7fa04a4683de0583774fab0e881bae7193 /src/fmt | |
| parent | df89f2ba53aab53356be197c581d142cefc2c6bc (diff) | |
| download | go-7d87ccc860dc31c0cd60faf00720e2f30fd37efb.tar.xz | |
all: fix various doc comment formatting nits
A run of lines that are indented with any number of spaces or tabs
format as a <pre> block. This commit fixes various doc comments
that format badly according to that (standard) rule.
For example, consider:
// - List item.
// Second line.
// - Another item.
Because the - lines are unindented, this is actually two paragraphs
separated by a one-line <pre> block. This CL rewrites it to:
// - List item.
// Second line.
// - Another item.
Today, that will format as a single <pre> block.
In a future release, we hope to format it as a bulleted list.
Various other minor fixes as well, all in preparation for reformatting.
For #51082.
Change-Id: I95cf06040d4186830e571cd50148be3bf8daf189
Reviewed-on: https://go-review.googlesource.com/c/go/+/384257
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/fmt')
| -rw-r--r-- | src/fmt/doc.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/fmt/doc.go b/src/fmt/doc.go index 6b49deda87..4151b39ea6 100644 --- a/src/fmt/doc.go +++ b/src/fmt/doc.go @@ -115,10 +115,11 @@ 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; + + '+' always print a sign for numeric values; guarantee ASCII-only output for %q (%+q) - - pad with spaces on the right rather than the left (left-justify the field) - # alternate format: add leading 0b for binary (%#b), 0 for octal (%#o), + '-' pad with spaces on the right rather than the left (left-justify the field) + '#' alternate format: add leading 0b for binary (%#b), 0 for octal (%#o), 0x or 0X for hex (%#x or %#X); suppress 0x for %p (%#p); for %q, print a raw (backquoted) string if strconv.CanBackquote returns true; @@ -127,7 +128,7 @@ Other flags: write e.g. U+0078 'x' if the character is printable for %U (%#U). ' ' (space) leave a space for elided sign in numbers (% d); put spaces between bytes printing strings or slices in hex (% x, % X) - 0 pad with leading zeros rather than spaces; + '0' pad with leading zeros rather than spaces; for numbers, this moves the padding after the sign; ignored for strings, byte slices and byte arrays |
