Skip to content

Fix golangci-lint compatibility with Go 1.26#430

Open
raghavendra-nataraj wants to merge 2 commits intomainfrom
fix/golangci-lint-go126-compat
Open

Fix golangci-lint compatibility with Go 1.26#430
raghavendra-nataraj wants to merge 2 commits intomainfrom
fix/golangci-lint-go126-compat

Conversation

@raghavendra-nataraj
Copy link
Copy Markdown
Contributor

Problem

The CI lint job fails on \main\ because \golangci-lint v1\ (latest: v1.64.8, built with Go 1.25.9) cannot analyze code targeting Go 1.26:

\
level=error msg="Running error: can't run linter goanalysis_metalinter\ninspect: failed to load package grpc: could not load export data: no export data for "google.golang.org/grpc""
\\

This is a pre-existing issue on main — not caused by any recent change.

Fix

Upgrade from golangci-lint v1 to v2, which supports Go 1.26:

  1. **.golangci.yml**: Migrated to v2 format using \golangci-lint migrate\
    • Added required \�ersion: "2"\ field
    • Restructured linter settings (\gosimple/\stylecheck\ merged into \staticcheck)
    • Added standard exclusion presets
  2. **\Makefile**: Updated install path from \golangci-lint/cmd/golangci-lint\ to \golangci-lint/v2/cmd/golangci-lint\

Context

This unblocks PR #429 (gRPC CVE fix) which also has the lint failure.

Upgrade from golangci-lint v1 to v2 to fix the pre-existing CI lint
failure where v1 (built with Go 1.25) cannot lint code targeting Go 1.26.

Changes:
- Migrate .golangci.yml to v2 format (version field, restructured config)
- Update Makefile to install golangci-lint v2 import path

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@raghavendra-nataraj raghavendra-nataraj force-pushed the fix/golangci-lint-go126-compat branch from 787f340 to 2872a12 Compare April 20, 2026 18:01
Bump gRPC to v1.80.0 to address CG alert for authorization bypass CVE.
Also updates x/net (v0.48.0->v0.49.0) and x/sys (v0.39.0->v0.40.0).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@raghavendra-nataraj
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant