While I would not expect go vet to be able to analyze in general whether a function value wraps (or is) a printf-family function, might it be viable to analyze the more limited case of a function-scoped local variable which is assigned a function literal value?
The text was updated successfully, but these errors were encountered:
go vet has the ability to identify failf as a printf wrapper. The reason it does not identify it, to my understanding, is because failf is not a top-level function. That is, failf is not considered a printf wrapper as it is a variable whose contents can change.
go vet could be extended to cover locally defined functions such as failf and then check for input formatting issues iff such failfs are, for instance, only being called in the enclosing function and nothing else (e.g., passed as a parameter or assigned a value).
The question is, how prevalent is the code pattern just described? Could we somehow get data on that to justify the above described extension?