-
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: %+#v
or %#+v
: underspecified?
#44278
Comments
I don't see any ambiguity here. Both |
The question is what happens when the operand implements neither the |
I don't see anything that says that the |
Sorry, I messed up the example at the last minute by trying to substitute a "simpler" one.
How do we interpret the documentation to figure out what we get with We could take that the output of |
Given that I don't think the docs can be read another way, and given that |
Closing old issues that still have the WaitingForInfo label where enough details to investigate weren't provided. Feel free to leave a comment with more details and we can reopen. |
I saw someone trying to use
%+#v
or%#+v
with fmt, but I couldn't find in the doc what it's supposed to do (or even whether it's valid).I think this is the only relevant clause:
which doesn't seem to say unambiguously which one should take precedence when both
#
and+
are used. There's some asymmetry in the description of%+v
and%#v
, which seems to suggest that#
takes precedence, but it's far from clear.I believe the descriptions for both should fall under that of
%v
, with an added disambiguation for+#
or#+
.This seems to favor
#
whenever it's used, but it doesn't apply unless the operand implements the GoStringer interface.The text was updated successfully, but these errors were encountered: