-
Notifications
You must be signed in to change notification settings - Fork 18k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fmt: unexpected behaviour for missing verb #5508
Labels
Comments
Owner changed to @robpike. |
This is a confusing example (Println of Sprintf for some reason, and then no arguments, so there are multiple things happening). The error reported is mostly about missing arguments, not bad format verbs, so the complaint is malformed. But let's take it at face value with a proper example: fmt.Printf("%w\n", 3) which gives %!w(int=3) That seems like a reasonable error message. You get the erroneous verb reported, and the value is printed regardless. The provided example with arguments: fmt.Printf(".%2a%3a4.1%3a29\n", 3, 4, 5) which gives .%!a(int= 3)%!a(int= 4)4.1%!a(int= 5)29 I claim that's fine. Verbs in general cannot be outlawed, since a Formatter interface is allowed to take any verb at all. We could check that a Formatter is being used and then complain, but the way we complain wouldn't really be any different. Working as intended. Status changed to WorkingAsIntended. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: