cmd/vet: Should warn against using %v print verb in Error() methods #33884
Labels
FeatureRequest
Issues asking for a new feature that does not need a proposal.
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes (1.12.9 is the latest release).
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I accidentally used the default printing verb (
%v
) in anError()
method on a struct, causing a stack overflow.https://play.golang.org/p/P6Vpeg6-JDv
What did you expect to see?
I expected
vet
to catch the mistake and warn me about it, like it does when attempting to do this in aString()
method.https://play.golang.org/p/kw_-rXcc7iv
What did you see instead?
I received no warning and took down production 🙃.
The text was updated successfully, but these errors were encountered: