From 285c2c2506253c5d6ddf72d3beb1d0a6453aba80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Feb 2024 21:37:39 +0000 Subject: [PATCH 1/2] build(deps): bump github.com/catenacyber/perfsprint from 0.5.0 to 0.6.0 Bumps [github.com/catenacyber/perfsprint](https://github.com/catenacyber/perfsprint) from 0.5.0 to 0.6.0. - [Commits](https://github.com/catenacyber/perfsprint/compare/v0.5.0...v0.6.0) --- updated-dependencies: - dependency-name: github.com/catenacyber/perfsprint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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= From f8c231c0ab20f4f19435a7082310108c4043c768 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Fri, 2 Feb 2024 22:41:22 +0100 Subject: [PATCH 2/2] chore: update implementation --- pkg/golinters/perfsprint.go | 17 ++++++++--------- test/testdata/perfsprint.go | 2 +- test/testdata/perfsprint_custom.go | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) 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() {