I’ve found an interesting behavior of
go vet with sprintf which I would not expect (it’s inside the lint check).
For this check, I get a violation:
When I pass more arguments into
Sprintf than expected, everything is fine from
go vet perspective:
fmt.Sprintf("%s", "foo", "bar")
Could you explain me why
go vet is not throwing a violation in this case? I’d expect it should also cover this case as developer might forget to update the formatting string. Or, at least to have a possibility to turn this kind of check on by configuration.
Thanks for explanation.