Skip to content

Use a pinned Go version for golangci-lint.#2151

Merged
alcaeus merged 1 commit into
mongodb:release/1.17from
matthewdale:fix-golangci
Aug 1, 2025
Merged

Use a pinned Go version for golangci-lint.#2151
alcaeus merged 1 commit into
mongodb:release/1.17from
matthewdale:fix-golangci

Conversation

@matthewdale

@matthewdale matthewdale commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

Summary

  • Copy etc/golangci-lint.sh from master, which uses a pinned Go version for running golangci-lint.
  • Copy the test.yml Github workflow from master.

Background & Motivation

The golangci-lint linter uses the local Go installation discovered in GOROOT and requires a specific range of Go versions to work correctly. If the local Go installation and the golangci-lint version get out-of-sync, the linters can print confusing error messages like

mongo/integration/mtest/mongotest.go:15:2: could not import sync/atomic (-: could not load export data: internal error in importing "sync/atomic" (unsupported version: 2); please report an issue) (typecheck)
        "sync/atomic"
        ^

In master, we added a script with #1826 that pins a specific version of Go when running golangci-lint. Use that same script here.

@matthewdale matthewdale requested a review from alcaeus July 31, 2025 21:23
@mongodb-drivers-pr-bot mongodb-drivers-pr-bot Bot added the review-priority-low Low Priority PR for Review: within 3 business days label Jul 31, 2025
@mongodb-drivers-pr-bot

Copy link
Copy Markdown
Contributor

API Change Report

No changes found!

@alcaeus alcaeus merged commit 9bfea8e into mongodb:release/1.17 Aug 1, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-priority-low Low Priority PR for Review: within 3 business days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants