From 8986f6568a587ebacd06c82a9f8a17be720ba04b Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 11 Apr 2022 10:32:29 +0200 Subject: [PATCH] chore: update --- .golangci.yml | 1 + pkg/commands/help.go | 2 +- pkg/lint/lintersdb/enabled_set.go | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 08c56f45a8ea..6f9069ab6d6b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -28,6 +28,7 @@ linters-settings: - octalLiteral - whyNoLint - wrapperFunc + - todoCommentWithoutDetail gocyclo: min-complexity: 15 goimports: diff --git a/pkg/commands/help.go b/pkg/commands/help.go index 677018a6ca3b..a6ed4c84fe01 100644 --- a/pkg/commands/help.go +++ b/pkg/commands/help.go @@ -39,7 +39,7 @@ func (e *Executor) initHelp() { func printLinterConfigs(lcs []*linter.Config) { sort.Slice(lcs, func(i, j int) bool { - return strings.Compare(lcs[i].Name(), lcs[j].Name()) < 0 + return lcs[i].Name() < lcs[j].Name() }) for _, lc := range lcs { altNamesStr := "" diff --git a/pkg/lint/lintersdb/enabled_set.go b/pkg/lint/lintersdb/enabled_set.go index 9814aa857ea9..907c1c4dbfe9 100644 --- a/pkg/lint/lintersdb/enabled_set.go +++ b/pkg/lint/lintersdb/enabled_set.go @@ -3,7 +3,6 @@ package lintersdb import ( "os" "sort" - "strings" "github.com/golangci/golangci-lint/pkg/config" "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" @@ -123,7 +122,7 @@ func (es EnabledSet) GetOptimizedLinters() ([]*linter.Config, error) { if a.DoesChangeTypes != b.DoesChangeTypes { return b.DoesChangeTypes // move type-changing linters to the end to optimize speed } - return strings.Compare(a.Name(), b.Name()) < 0 + return a.Name() < b.Name() }) return resultLinters, nil @@ -168,7 +167,7 @@ func (es EnabledSet) combineGoAnalysisLinters(linters map[string]*linter.Config) return false } - return strings.Compare(a.Name(), b.Name()) <= 0 + return a.Name() <= b.Name() }) ml := goanalysis.NewMetaLinter(goanalysisLinters)