Skip to content

Migrate golangci lint v2#323

Merged
k8s-ci-robot merged 7 commits intokubernetes-sigs:mainfrom
kkk777-7:update-golangci-lint
Jan 30, 2026
Merged

Migrate golangci lint v2#323
k8s-ci-robot merged 7 commits intokubernetes-sigs:mainfrom
kkk777-7:update-golangci-lint

Conversation

@kkk777-7
Copy link
Copy Markdown
Member

@kkk777-7 kkk777-7 commented Jan 29, 2026

What this PR does / why we need it:
Migrate golangci-lint v2.

#305 supports Envoy Gateway Emitter.
Envoy Gateway’s latest version requires Go 1.25.3. But, golangci-lint v1 doesn’t support Go 1.25.
This causes CI failure.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:


Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 29, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @kkk777-7. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kkk777-7 kkk777-7 changed the title Update golangci lint Migrate golangci lint v2 Jan 29, 2026
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 29, 2026
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
Comment thread .golangci.yml
allow-parallel-runners: false

linters:
fast: false
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread .golangci.yml
- govet
- misspell
disable-all: false
presets:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linters.presets removed.
https://golangci-lint.run/docs/product/migration-guide/#linterspresets

migrate: individual linters to linters.enable

Comment thread .golangci.yml
- linters:
- staticcheck
text: "ST1005:"
# Allow embedded field, currently this style is used in many places
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we should fix this style, I'll fix in this PR.

Comment thread .golangci.yml
timeout: 10m
issues-exit-code: 1
tests: true
exclude-dirs-use-default: true
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exclude-dirs-use-default replaces

linters:
  exclusions:
    paths:
      - third_party$
      - builtin$
      - examples$

https://golangci-lint.run/docs/product/migration-guide/#issuesexclude-dirs-use-default

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kkk777-7, Stevenjin8

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 29, 2026
@Stevenjin8
Copy link
Copy Markdown
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 29, 2026
@Stevenjin8
Copy link
Copy Markdown
Contributor

Got @rikatz blessing on Slack, so also going to /lgtm on his behalf

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 30, 2026
@k8s-ci-robot k8s-ci-robot merged commit 4c4cc31 into kubernetes-sigs:main Jan 30, 2026
5 checks passed
@rikatz
Copy link
Copy Markdown
Member

rikatz commented Jan 30, 2026

sorry I should have given lgtm, but lgtm! thanks @Stevenjin8 :D

rajashish pushed a commit to rajashish/ingress2gateway1 that referenced this pull request Feb 21, 2026
* migrate golangci-lint v2

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

* fix: gosec lint

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

* fix: govet lint

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

* fix: testifylint

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

* fix: staticcheck

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

* update go version in workflow

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

* revert timeout

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>

---------

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants