• 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
..
internal/whitelist Loading commit data...
testdata Loading commit data...
README Loading commit data...
asmdecl.go Loading commit data...
assign.go Loading commit data...
atomic.go Loading commit data...
bool.go Loading commit data...
buildtag.go Loading commit data...
cgo.go Loading commit data...
composite.go Loading commit data...
copylock.go Loading commit data...
deadcode.go Loading commit data...
doc.go Loading commit data...
main.go Loading commit data...
method.go Loading commit data...
nilfunc.go Loading commit data...
print.go Loading commit data...
rangeloop.go Loading commit data...
shadow.go Loading commit data...
shift.go Loading commit data...
structtag.go Loading commit data...
tests.go Loading commit data...
types.go Loading commit data...
unsafeptr.go Loading commit data...
unused.go Loading commit data...
vet_test.go Loading commit data...