{"record":{"id":"5517808bde542653","repo":"golangci/golangci-lint","slug":"this-linter-is-disabled-because-the-go-version-s","errorCode":null,"errorMessage":"this linter is disabled because the Go version (%s) of your project is lower than Go %s","messagePattern":"this linter is disabled because the Go version \\((.+?)\\) of your project is lower than Go (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/lint/linter/config.go","lineNumber":222,"sourceCode":"\t\t\t\treturn \"\", fmt.Errorf(\"%s: invalid configuration: %w\", d.Replacement, err)\n\t\t\t}\n\n\t\t\treturn buf.String(), nil\n\t\t}\n\t}\n}\n\nfunc IsGoLowerThanGo122() func(cfg *config.Config) error {\n\treturn isGoLowerThanGo(\"1.22\")\n}\n\nfunc isGoLowerThanGo(v string) func(cfg *config.Config) error {\n\treturn func(cfg *config.Config) error {\n\t\tif cfg == nil || config.IsGoGreaterThanOrEqual(cfg.Run.Go, v) {\n\t\t\treturn nil\n\t\t}\n\n\t\treturn fmt.Errorf(\"this linter is disabled because the Go version (%s) of your project is lower than Go %s\", cfg.Run.Go, v)\n\t}\n}\n","sourceCodeStart":204,"sourceCodeEnd":225,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/lint/linter/config.go#L204-L225","documentation":"isGoLowerThanGo returns a validator that disables a linter when the project's configured Go version (cfg.Run.Go) is lower than the minimum version the linter supports. It produces this message telling the user the linter was disabled for that reason.","triggerScenarios":"A linter enabled via config or defaults declares isGoLowerThanGo(\"1.22\") (say), and the config sets run.go to a lower version (e.g. \"1.21\") — or run.go is unset and defaults below the threshold.","commonSituations":"Projects whose go.mod/go directive is older than the linter's minimum; forgetting to set `run.go` after upgrading the toolchain; enabling modern linters (e.g. those requiring Go 1.22+ analysis) in legacy codebases.","solutions":["Raise the Go version in go.mod (`go mod edit -go=1.22` and set run.go in .golangci.yml) if your code actually targets that version.","Explicitly set the correct `run.go` value in .golangci.yml to match your project's language version.","If you must stay on the old Go version, accept the linter is disabled or remove it from config to silence the message.","Upgrade the project/toolchain to at least the minimum version the linter requires."],"exampleFix":"// before (.golangci.yml)\nrun:\n  go: '1.20'\n\n// after\nrun:\n  go: '1.22'","handlingStrategy":"validation","validationCode":"goMod, _ := os.ReadFile(\"go.mod\")\n// ensure the go directive >= every enabled linter's minimum\nif !strings.Contains(string(goMod), \"go 1.22\") {\n    log.Warn(\"project targets Go < 1.22; some linters will be disabled\")\n}","typeGuard":null,"tryCatchPattern":"if err := validateLintersConfig(cfg); err != nil {\n    if strings.Contains(err.Error(), \"is disabled because the Go version\") {\n        log.Warnf(\"linter skipped: %v\", err)\n        return nil // non-fatal: linter disabled by design\n    }\n    return err\n}","preventionTips":["Keep run.go (and go.mod's go directive) at the actual minimum version your code supports.","Check each enabled linter's minimum Go version when adding it to config.","Bump the project Go version promptly when adopting newer linters."],"tags":["go","configuration","version-compatibility"],"backgroundTag":"go-version-too-low-for-linter","analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}