x/tools/go/analysis: warn on Printf(fmt) #37935
Labels
Analysis
Issues related to static analysis (vet, x/tools/go/analysis)
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Consider the code:
The
log.Printf
call will interpretmsg
as a format string, causing unexpected results ifmsg
contains formatting characters.We could warn on a call to a formatting function with a single non-constant parameter. These calls can always be safely converted to the equivalent non-formatting function.
The text was updated successfully, but these errors were encountered: