Refactor code to enable some lint checks
After upgrading golangci-lint to v2.4.0 (2025-08-14), CI started failing:
https://github.com/containerd/nerdctl/actions/runs/17294879972/job/49090536229?pr=4490 https://github.com/containerd/nerdctl/actions/runs/17294879986/job/49090535739?pr=4490
As a temporary workaround, we’ve disabled the following linters:
- name: redundant-test-main-exit
disabled: true
- name: enforce-switch-style
disabled: true
- name: var-naming
disabled: true
We need refactor code to re-enabe these checks.
Details: https://github.com/containerd/nerdctl/pull/4490
cc @AkihiroSuda
See also https://github.com/containerd/nerdctl/blob/741dd8750aa615cd5a0350994c905b9d23a7baa8/.golangci.yml#L83-L189
Hey @AkihiroSuda! Can I take this up?
Also, would it make sense to break it into multiple PRs to reduce code churn?
Yes, thanks
This should be multiple PRs
Hey @AkihiroSuda! I've added the first PR #4496
var-naming linter would need a decision, we use utils & types as package names, but they are discouraged for being too vague.
I'll start from these ones in the next PR https://github.com/containerd/nerdctl/blob/8d3ad046ca17f67086e8ccfba5f9a7137e73e327/.golangci.yml#L83-L104
Hi! Me, @ShivanshNikhra, and @aravsrid are a group of three students working on open-source issues for our virtualization course. We’re interested in taking on this issue and coordinating the work among ourselves to submit a single PR for one of the lint checks.
We estimate we can complete it within the next month. Would it be okay if we proceed with this issue? If you prefer assignments, we’re happy to be assigned as well. Thanks!
Would it be okay if we proceed with this issue?
Feel free to work on any issue you like, but I'm not sure if fixing lint issues is the right task for your school assignment. I suggest asking your professor.
Our professor wants us to work on any virtualization-related open-source repositories. We have his approval to work on the issues I've commented on. Is there any chance these issues could be assigned to us? Thanks!
Hi @AkihiroSuda! Sorry for the spam, but thanks for assigning us to this issue.
For our course, we’re planning to work on a few other issues as well:
- https://github.com/containerd/nerdctl/issues/4595
- https://github.com/containerd/nerdctl/issues/4262
- https://github.com/containerd/nerdctl/issues/4338
- https://github.com/containerd/nerdctl/issues/3751
Would it be alright if we were assigned these as well? Thanks again for your time and help!