golangci/golangci-lint · warning

this linter is disabled because the Go version (%s) of your

Error message

this linter is disabled because the Go version (%s) of your project is lower than Go %s

What it means

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.

Source

Thrown at pkg/lint/linter/config.go:222

				return "", fmt.Errorf("%s: invalid configuration: %w", d.Replacement, err)
			}

			return buf.String(), nil
		}
	}
}

func IsGoLowerThanGo122() func(cfg *config.Config) error {
	return isGoLowerThanGo("1.22")
}

func isGoLowerThanGo(v string) func(cfg *config.Config) error {
	return func(cfg *config.Config) error {
		if cfg == nil || config.IsGoGreaterThanOrEqual(cfg.Run.Go, v) {
			return nil
		}

		return fmt.Errorf("this linter is disabled because the Go version (%s) of your project is lower than Go %s", cfg.Run.Go, v)
	}
}

View on GitHub (pinned to ed7a235d2d)

Solutions

  1. 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.
  2. Explicitly set the correct `run.go` value in .golangci.yml to match your project's language version.
  3. If you must stay on the old Go version, accept the linter is disabled or remove it from config to silence the message.
  4. Upgrade the project/toolchain to at least the minimum version the linter requires.

Example fix

// before (.golangci.yml)
run:
  go: '1.20'

// after
run:
  go: '1.22'
Defensive patterns

Strategy: validation

Validate before calling

goMod, _ := os.ReadFile("go.mod")
// ensure the go directive >= every enabled linter's minimum
if !strings.Contains(string(goMod), "go 1.22") {
    log.Warn("project targets Go < 1.22; some linters will be disabled")
}

Try / catch

if err := validateLintersConfig(cfg); err != nil {
    if strings.Contains(err.Error(), "is disabled because the Go version") {
        log.Warnf("linter skipped: %v", err)
        return nil // non-fatal: linter disabled by design
    }
    return err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of golangci/golangci-lint@ed7a235d2d (2026-09-02). Data as JSON: /api/errors/5517808bde542653. Report an issue: GitHub.