-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/vet: errors on unknown Printf verb that type implements when using log.Printf #31000
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
Comments
Here's the implementation of |
Hmm, I can reproduce the vet warning on I haven't formed an opinion on whether this is a bug or not; I just can't reproduce this being a regression or being fixed in tip. |
Seems the same as #30399: cmd/vet shouldn't complain about the use of an unrecognized formatting character with a type that implements |
Hmm, I don't think it's an exact duplicate. That was fixed in x/tools master weeks ago, and Edit: to clarify, the reason I don't think it's an exact duplicate is because I still get the warning with |
I was the author of the change in I definitely agree that |
Did some more testing and this does seem to be the same issue as #30399. If I change my code to use |
This generates the error:
This does not:
|
Ok, I finally get what's going on. This is using This explains why I was getting the warning at every Go version. Anyway, yes, this is indeed a duplicate of #30399, and a backport is already ready for 1.12.2. |
@mvdan I'm not using modules, so I'm using neither. |
Well, the original report didn't mention any version, so my assumption was "the latest tagged version". It would have been easier if the post was clear :) |
Based on quick testing, this issue looks like it may be fixed in
tip
and needs a backport to1.12.x
.What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
1.11.6
: no1.12.1
: yestip
: noWhat operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Contents of
file.go
:What did you expect to see?
No error.
The text was updated successfully, but these errors were encountered: