Join GitHub today
proposal: cmd/vet: Add some popular printf-like methods to hardcoded list #24691
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
There are three criteria listed in src/cmd/vet/README. For a change for vet to be accepted, it must first satisfy those rules. I am concerned about precision and frequency and maybe even correctness in this case.
It may be that all that's needed and proper is to advertise the flag better, as you have done.
Hi Rob, yes, I understand the concern of precision and frequency. I think that namely: Wrapf, Warnf, Infof, Failf - meets this requirement. I can explain why (I played with sourcegraph https://sourcegraph.com/search?q=wrapf+infof+warnf+failf):
So, if you think we may proceed with these 4 names, let me know. It will be useful.
Also, can you please clarify if there are reason that "go vet" doesn't follow "standard" solution: special attributes at function declaration , like extension of C++ compilers attribute((format (printf,...) or Microsoft SAL Annotations.
If this is an option that we may consider, I am willing to work on proposal.
changed the title
cmd/vet: Add some popular printf-like methods to hardcoded list
Apr 9, 2018
See https://go-review.googlesource.com/#/c/go/+/108559 for the approach I was talking about (not yet ready for review but you can play with it).