dominikh / go-tools

Staticcheck - The advanced Go linter
https://staticcheck.dev
MIT License
6.01k stars 361 forks source link

SA1006: flag more functions #1542

Closed arp242 closed 4 weeks ago

arp242 commented 1 month ago

Flag all stdlib functions that have both a Printf() and Print() variant.

Found with:

% rg -g '!internal/' -g '!cmd/' '^func ([()*a-zA-Z0-9_ ]+)?[A-Z]\w+\(\w+ string, \w+ \.\.\.any\)'

(will need to filter out some false positives)

Fixes #1528

arp242 commented 1 month ago

Added a second commit to special-case fixing fmt.Errorf() → errors.New(). Previously that would get "fixed" to fmt.Error(). Just adding a note since you already approved this PR.