• Spencer Nelson's avatar
    cmd/vet: Use function signature to find format string index. · 867910ea
    Spencer Nelson authored
    cmd/vet's printf checker currently uses a hardcoded map of function
    names to expected positions of format strings. We can be a bit more
    precise than this by looking up the signature of the function, which
    helps when libraries implement functions like Errorf or Logf with
    extra arguments like log levels or error codes.
    
    Specifically, the format string param is assumed to be the last string
    parameter of the called function.
    
    Fixes #12294.
    
    Change-Id: Icf10ebb819bba91fa1c4109301417042901e34c7
    Reviewed-on: https://go-review.googlesource.com/20163
    Run-TryBot: Rob Pike <r@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRob Pike <r@golang.org>
    867910ea
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...