Skip to content

🌱 add Go 1.26 support with golangci-lint v2.12.2 - #225

Merged
openshift-merge-bot[bot] merged 1 commit into
open-cluster-management-io:mainfrom
tesshuflower:update-golangci-lint-go126
May 29, 2026
Merged

🌱 add Go 1.26 support with golangci-lint v2.12.2#225
openshift-merge-bot[bot] merged 1 commit into
open-cluster-management-io:mainfrom
tesshuflower:update-golangci-lint-go126

Conversation

@tesshuflower

@tesshuflower tesshuflower commented May 28, 2026

Copy link
Copy Markdown
Contributor

Updates both lint scripts to use golangci-lint v2.12.2 for Go 1.26+ projects.

golangci-lint v2.12.2 is built with Go 1.26.2 and supports linting Go 1.26 code.

Version mapping:

  • Go 1.26+ → golangci-lint v2.12.2
  • Go 1.24-1.25 → golangci-lint v2.8.0
  • Go 1.23 → golangci-lint v2.3.1

Summary by CodeRabbit

  • Chores
    • Updated CI linting infrastructure to support Go 1.26+
    • Extended compatibility version mappings to automatically select appropriate linting tools for Go 1.26 and later
    • Enhanced linting pipeline configuration to recognize and properly handle newer Go language versions

Review Change Stack

@openshift-ci
openshift-ci Bot requested review from qiujian16 and xuezhaojun May 28, 2026 19:42
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Walkthrough

This PR adds Go 1.26+ support to the golangci-lint tooling by mapping Go 1.26 and later to golangci-lint v2.12.2. The compatibility mapping is documented and implemented in install-golangci-lint.sh, while the runtime version detection in run-lint.sh is updated to select the same version for Go 1.26+.

Changes

Go 1.26+ golangci-lint version support

Layer / File(s) Summary
Install-time version compatibility mapping
ci/lint/install-golangci-lint.sh
Compatibility table is updated with Go 1.26+ → v2.12.2 mapping, and select_compatible_version() adds a conditional branch to return v2.12.2 for Go versions >= 1.26.
Run-time version detection
ci/lint/run-lint.sh
detect_versions() function adds a new conditional gate for Go 1.26+ that sets LINT_VERSION to v2.12.2 before the existing Go 1.24+ fallback logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

lgtm

Suggested reviewers

  • qiujian16
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description covers the main changes and includes a version mapping table, but it does not follow the repository's template structure with required sections like Summary and Related issue(s). Restructure the description to match the template: add a Summary section, specify any Related issue(s), and organize the version mapping information accordingly.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding Go 1.26 support with a specific golangci-lint version (v2.12.2), which directly corresponds to the core modifications in both lint scripts.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Update both lint scripts to use golangci-lint v2.12.2 for Go 1.26+ projects.

golangci-lint v2.12.2 is built with Go 1.26.2 and can lint Go 1.26 code.
Previous versions (v2.8.0) were built with Go 1.25 and fail with:
'the Go language version used to build golangci-lint is lower than the targeted Go version'

Version mapping:
- Go 1.26+ -> golangci-lint v2.12.2
- Go 1.24-1.25 -> golangci-lint v2.8.0
- Go 1.23 -> golangci-lint v2.3.1

Signed-off-by: Tesshu Flower <tflower@redhat.com>
@tesshuflower
tesshuflower force-pushed the update-golangci-lint-go126 branch from 7ff09c9 to 0510341 Compare May 28, 2026 19:44
@tesshuflower tesshuflower changed the title feat: add Go 1.26 support with golangci-lint v2.12.2 🌱 add Go 1.26 support with golangci-lint v2.12.2 May 28, 2026
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Actionable comments posted: 0

@xuezhaojun

Copy link
Copy Markdown
Member

/lgtm

@xuezhaojun

Copy link
Copy Markdown
Member

/approve

@openshift-ci

openshift-ci Bot commented May 29, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tesshuflower, xuezhaojun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit 3ea63fb into open-cluster-management-io:main May 29, 2026
9 of 10 checks passed
@tesshuflower
tesshuflower deleted the update-golangci-lint-go126 branch May 29, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants