-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed as not planned
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.
Milestone
Description
What is the URL of the page with the issue?
What is your user agent?
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Screenshot
What did you do?
fmt.Printf("%8s", "ab")
fmt.Printf("%8s", "abcdefghijklmn")
What did you expect to see?
ab
abcdefgh
What did you see instead?
ab
abcdefghijklmn
Problem is this phrase: "For strings, byte slices and byte arrays, however, precision limits the length of the input to be formatted (not the size of the output), truncating if necessary. ". The reality is the exact opposite. "%8s" will cause the output to padded with space; and not the input to be truncated. Either behavior is useful, but the doc states the wrong one.
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.
