We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
main
go env
irrelevant
Pass %T to a format function with an arg that implements fmt.Formatter
fmt.Formatter.Format is not invoked for %T verb. It's also not documented. I believe %p is the same.
The type of the arg is printed, rather than performing the action of fmt.Formatter.Format for the type with the T verb.
T
The result of executing fmt.Formatter.Format for the arg's type.
The text was updated successfully, but these errors were encountered:
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Sorry, something went wrong.
Although one could argue it should pass T to the Formatter, I intended it for debugging and so it deliberately ignores all the non-standard routes.
So perhaps unfortunate in your case but it's working as intended, according to its author.
This is documented.
Except when printed using the verbs %T and %p, special formatting considerations apply for operands that implement certain interfaces.
Thanks, don't know how I missed that.
No branches or pull requests
Go version
main
Output of
go env
in your module/workspace:What did you do?
Pass %T to a format function with an arg that implements fmt.Formatter
fmt.Formatter.Format is not invoked for %T verb. It's also not documented. I believe %p is the same.
What did you see happen?
The type of the arg is printed, rather than performing the action of fmt.Formatter.Format for the type with the
T
verb.What did you expect to see?
The result of executing fmt.Formatter.Format for the arg's type.
The text was updated successfully, but these errors were encountered: