Skip to content

Commit 71df6c3

Browse files
committed
fixup! linter: add perfsprint
1 parent ba81211 commit 71df6c3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: pkg/golinters/perfsprint.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
88
)
99

10-
func NewGoStrconv() *goanalysis.Linter {
10+
func NewPerfSprint() *goanalysis.Linter {
1111
return goanalysis.NewLinter(
1212
"perfsprint",
1313
"Checks usages of `fmt.Sprintf` which have faster alternatives.",

Diff for: pkg/lint/lintersdb/manager.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
714714

715715
linter.NewConfig(golinters.NewPerfSprint()).
716716
WithSince("v1.54.2").
717-
WithPresets(linter.PresetStyle).
717+
WithPresets(linter.PresetPerformance).
718718
WithURL("https://github.com/catenacyber/perfsprint"),
719719

720720
linter.NewConfig(golinters.NewPreAlloc(preallocCfg)).

Diff for: test/testdata/perfsprint.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ package testdata
44
import "fmt"
55

66
func SprintfCouldBeStrconv() {
7-
fmt.Sprintf("%d", 42) // want "Sprintf can be replaced with faster strconv.Itoa"
7+
fmt.Sprintf("%d", 42) // want "fmt.Sprintf can be replaced with faster function strconv.Itoa"
88
}

0 commit comments

Comments
 (0)