-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: error verb rune 'w', overriding/breaking fmt.formatter implementation #56562
Comments
This looks like a bug in the checking of 'w', which occurs before seeing if the type implements Formatter. |
There's also a vet check that verifies that the operand to 'w' is an Perhaps the bug is that we don't document that it is not valid to use '%w' with any function other than |
reported because seemed like it had to be that, because its hidden by its rarity and also because it didn't seem too 'invasive' to fix. |
Why is '%w' special in this regard? |
'%w' is the error wrapping verb. It indicates that Passing '%w' to any formatting function other than |
just tried to use rune 'p' in a bespoke formatter (for percentage) also seems to be blocked from working because of its use in the non-overridden default code. as pointer type formatter! why implementing fmt.Formatter doesn't simply override the default is surprising. |
https://go.dev/play/p/eM3d8y2L768
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: