Skip to content

golangci-lint fails when local Go version differs from Bazel-managed version #72

@albertocavalcante

Description

@albertocavalcante

Problem

When running make lint, golangci-lint fails with version mismatch errors if the local Go installation version differs from the Bazel-managed Go version.

Current versions:

  • Local Go: 1.24.1
  • Bazel-managed Go: 1.23.7

This causes false positives in the linting process, even though the code is correct.

Current Workaround

Currently, we need to skip the lint step when we know it's a false positive due to the Go version mismatch.

Potential Solutions

  1. Use nogo analyzer from rules_go (requires significant rework)

  2. Use bazel-nogo-lint (experimental)

  3. Configure golangci-lint to use Bazel's Go version (not directly supported yet)

Next Steps

  1. Research and evaluate the potential solutions
  2. Choose the most appropriate solution based on:
    • Maintenance overhead
    • Integration complexity
    • Long-term sustainability

Related Rules

From our Go rules:

AVOID using the local go installation on the host machine. PREFER to use the Bazel-managed Go SDK via rules_go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions