Skip to content

Refactor code to enable some lint checks #4493

@ChengyuZhu6

Description

@ChengyuZhu6

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: #4490

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions