Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 8 additions & 9 deletions pkg/golinters/perfsprint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/perfsprint.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package testdata

import (
"fmt" // want "Fix imports"
"fmt"
)

func TestPerfsprint() {
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/perfsprint_custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package testdata

import (
"fmt" // want "Fix imports"
"fmt"
)

func TestPerfsprint2() {
Expand Down