diff --git a/go.mod b/go.mod index a37cebeaf085..e4f948a041b3 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/breml/errchkjson v0.3.6 github.com/butuzov/ireturn v0.2.2 github.com/butuzov/mirror v1.1.0 - github.com/catenacyber/perfsprint v0.5.0 + github.com/catenacyber/perfsprint v0.6.0 github.com/charithe/durationcheck v0.0.10 github.com/curioswitch/go-reassign v0.2.0 github.com/daixiang0/gci v0.12.1 diff --git a/go.sum b/go.sum index fa8a9a8dd300..b581b63248e2 100644 --- a/go.sum +++ b/go.sum @@ -97,8 +97,8 @@ github.com/butuzov/ireturn v0.2.2 h1:jWI36dxXwVrI+RnXDwux2IZOewpmfv930OuIRfaBUJ0 github.com/butuzov/ireturn v0.2.2/go.mod h1:RfGHUvvAuFFxoHKf4Z8Yxuh6OjlCw1KvR2zM1NFHeBk= github.com/butuzov/mirror v1.1.0 h1:ZqX54gBVMXu78QLoiqdwpl2mgmoOJTk7s4p4o+0avZI= github.com/butuzov/mirror v1.1.0/go.mod h1:8Q0BdQU6rC6WILDiBM60DBfvV78OLJmMmixe7GF45AE= -github.com/catenacyber/perfsprint v0.5.0 h1:FNBJRKm2Lar44u1s7DUfpbiY4iN2LmnK6THY3d5rL40= -github.com/catenacyber/perfsprint v0.5.0/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= +github.com/catenacyber/perfsprint v0.6.0 h1:VSv95RRkk5+BxrU/YTPcnxuMEWar1iMK5Vyh3fWcBfs= +github.com/catenacyber/perfsprint v0.6.0/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= github.com/ccojocar/zxcvbn-go v1.0.1 h1:+sxrANSCj6CdadkcMnvde/GWU1vZiiXRbqYSCalV4/4= github.com/ccojocar/zxcvbn-go v1.0.1/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= diff --git a/pkg/golinters/perfsprint.go b/pkg/golinters/perfsprint.go index a74fd9fa69a0..acaa3a522547 100644 --- a/pkg/golinters/perfsprint.go +++ b/pkg/golinters/perfsprint.go @@ -11,16 +11,15 @@ import ( func NewPerfSprint(settings *config.PerfSprintSettings) *goanalysis.Linter { a := analyzer.New() - var cfg map[string]map[string]any + cfg := map[string]map[string]any{ + a.Name: {"fiximports": false}, + } + if settings != nil { - cfg = map[string]map[string]any{ - a.Name: { - "int-conversion": settings.IntConversion, - "err-error": settings.ErrError, - "errorf": settings.ErrorF, - "sprintf1": settings.SprintF1, - }, - } + cfg[a.Name]["int-conversion"] = settings.IntConversion + cfg[a.Name]["err-error"] = settings.ErrError + cfg[a.Name]["errorf"] = settings.ErrorF + cfg[a.Name]["sprintf1"] = settings.SprintF1 } return goanalysis.NewLinter( diff --git a/test/testdata/perfsprint.go b/test/testdata/perfsprint.go index 5fca3b4a7f8a..8799f8f1da89 100644 --- a/test/testdata/perfsprint.go +++ b/test/testdata/perfsprint.go @@ -2,7 +2,7 @@ package testdata import ( - "fmt" // want "Fix imports" + "fmt" ) func TestPerfsprint() { diff --git a/test/testdata/perfsprint_custom.go b/test/testdata/perfsprint_custom.go index 07687e58e520..cf4e5ca9d15b 100644 --- a/test/testdata/perfsprint_custom.go +++ b/test/testdata/perfsprint_custom.go @@ -3,7 +3,7 @@ package testdata import ( - "fmt" // want "Fix imports" + "fmt" ) func TestPerfsprint2() {