Skip to content

dev: remove unused function SetAnalyzerGoVersion #5085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 25, 2024
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
11 changes: 0 additions & 11 deletions pkg/golinters/internal/staticcheck_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -32,14 +29,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

Expand Down
9 changes: 4 additions & 5 deletions pkg/logutils/logutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading