Skip to content

Commit

Permalink
review: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Oct 19, 2023
1 parent ba81211 commit 1a7f4b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
12 changes: 7 additions & 5 deletions pkg/golinters/perfsprint.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import (
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
)

func NewGoStrconv() *goanalysis.Linter {
func NewPerfSprint() *goanalysis.Linter {
a := analyzer.Analyzer

return goanalysis.NewLinter(
"perfsprint",
"Checks usages of `fmt.Sprintf` which have faster alternatives.",
[]*analysis.Analyzer{analyzer.Analyzer},
a.Name,
a.Doc,
[]*analysis.Analyzer{a},
nil,
).WithLoadMode(goanalysis.LoadModeSyntax)
).WithLoadMode(goanalysis.LoadModeTypesInfo)
}
5 changes: 3 additions & 2 deletions pkg/lint/lintersdb/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,9 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
WithURL("https://github.com/kunwardeep/paralleltest"),

linter.NewConfig(golinters.NewPerfSprint()).
WithSince("v1.54.2").
WithPresets(linter.PresetStyle).
WithSince("v1.55.0").
WithLoadForGoAnalysis().
WithPresets(linter.PresetPerformance).
WithURL("https://github.com/catenacyber/perfsprint"),

linter.NewConfig(golinters.NewPreAlloc(preallocCfg)).
Expand Down

0 comments on commit 1a7f4b3

Please sign in to comment.