From bbda6e6b7f8fdbc95764ae0def37086514b6c91c Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 25 Oct 2024 14:13:53 +0300 Subject: [PATCH 1/2] dev: remove unused function SetAnalyzerGoVersion --- pkg/golinters/internal/staticcheck_common.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pkg/golinters/internal/staticcheck_common.go b/pkg/golinters/internal/staticcheck_common.go index 958013d0df2c..af0e88c72417 100644 --- a/pkg/golinters/internal/staticcheck_common.go +++ b/pkg/golinters/internal/staticcheck_common.go @@ -32,14 +32,6 @@ func SetupStaticCheckAnalyzers(src []*lint.Analyzer, checks []string) []*analysi return ret } -func SetAnalyzerGoVersion(a *analysis.Analyzer, goVersion string) { - if v := a.Flags.Lookup("go"); v != nil { - if err := v.Value.Set(goVersion); err != nil { - debugf("Failed to set go version: %s", err) - } - } -} - func StaticCheckConfig(settings *config.StaticCheckSettings) *scconfig.Config { var cfg *scconfig.Config From eedbbfef3e5179b05529b6a7ef4329185e2a2ff5 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Fri, 25 Oct 2024 13:50:33 +0200 Subject: [PATCH 2/2] review --- pkg/golinters/internal/staticcheck_common.go | 3 --- pkg/logutils/logutils.go | 9 ++++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/pkg/golinters/internal/staticcheck_common.go b/pkg/golinters/internal/staticcheck_common.go index af0e88c72417..e5a0e33b7d8b 100644 --- a/pkg/golinters/internal/staticcheck_common.go +++ b/pkg/golinters/internal/staticcheck_common.go @@ -9,11 +9,8 @@ import ( scconfig "honnef.co/go/tools/config" "github.com/golangci/golangci-lint/pkg/config" - "github.com/golangci/golangci-lint/pkg/logutils" ) -var debugf = logutils.Debug(logutils.DebugKeyMegacheck) - func SetupStaticCheckAnalyzers(src []*lint.Analyzer, checks []string) []*analysis.Analyzer { var names []string for _, a := range src { diff --git a/pkg/logutils/logutils.go b/pkg/logutils/logutils.go index e4bb98109db1..3c27e2557af1 100644 --- a/pkg/logutils/logutils.go +++ b/pkg/logutils/logutils.go @@ -60,11 +60,10 @@ const ( ) const ( - DebugKeyGoCritic = "gocritic" // Debugs `go-critic` linter. - DebugKeyGovet = "govet" // Debugs `govet` linter. - DebugKeyMegacheck = "megacheck" // Debugs `staticcheck` related linters. - DebugKeyNolint = "nolint" // Debugs a filter excluding issues by `//nolint` comments. - DebugKeyRevive = "revive" // Debugs `revive` linter. + DebugKeyGoCritic = "gocritic" // Debugs `go-critic` linter. + DebugKeyGovet = "govet" // Debugs `govet` linter. + DebugKeyNolint = "nolint" // Debugs a filter excluding issues by `//nolint` comments. + DebugKeyRevive = "revive" // Debugs `revive` linter. ) func getEnabledDebugs() map[string]bool {