Skip to content

Conversation

@AkihiroSuda
Copy link
Member

No description provided.

@AkihiroSuda AkihiroSuda added this to the v2.1.4 milestone Aug 28, 2025
@AkihiroSuda

This comment was marked as resolved.

@AkihiroSuda
Copy link
Member Author

AkihiroSuda commented Aug 29, 2025

Lint failures are annoying

Details

____________________________________________________________________________________________________
                                      🤓 lint-go: linux 🤓
____________________________________________________________________________________________________
level=warning msg="[runner/nolint_filter] Found unknown linters in //nolint directives: gosimple"
Error: cmd/nerdctl/compose/compose_ps.go:383:2: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/pkg/labels' package 'labels' (gocritic)
	labels, err := c.Labels(ctx)
	^
Error: cmd/nerdctl/container/container_create_linux_test.go:99:3: importShadow: shadow of imported from 'github.com/containerd/nerdctl/mod/tigron/expect' package 'expect' (gocritic)
		expect := test.Expect
		^
Error: cmd/nerdctl/container/container_create_linux_test.go:414:26: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/cmd/nerdctl/helpers' package 'helpers' (gocritic)
func getContainerHostUID(helpers test.Helpers, containerName string) (string, error) {
                         ^
Error: cmd/nerdctl/container/container_create_linux_test.go:431:56: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/cmd/nerdctl/helpers' package 'helpers' (gocritic)
func appendUsernsConfig(userns string, hostUID string, helpers test.Helpers) error {
                                                       ^
Error: cmd/nerdctl/container/container_create_linux_test.go:469:46: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/cmd/nerdctl/helpers' package 'helpers' (gocritic)
func addUser(username string, hostID string, helpers test.Helpers) {
                                             ^
Error: cmd/nerdctl/container/container_create_linux_test.go:476:54: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/cmd/nerdctl/helpers' package 'helpers' (gocritic)
func removeUsernsConfig(t *testing.T, userns string, helpers test.Helpers) {
                                                     ^
Error: cmd/nerdctl/container/container_create_linux_test.go:507:31: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/cmd/nerdctl/helpers' package 'helpers' (gocritic)
func delUser(username string, helpers test.Helpers) {
                              ^
Error: cmd/nerdctl/container/container_create_linux_test.go:511:33: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/cmd/nerdctl/helpers' package 'helpers' (gocritic)
func delGroup(groupname string, helpers test.Helpers) {
                                ^
Error: cmd/nerdctl/container/container_run_cgroup_linux_test.go:227:2: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/pkg/cmd/container' package 'container' (gocritic)
	container, err := client.LoadContainer(ctx, cid)
	^
Error: cmd/nerdctl/container/container_run_network.go:49:3: importShadow: shadow of imported package 'net' (gocritic)
		net, err := cmd.Flags().GetStringSlice("net")
		^
Error: cmd/nerdctl/container/container_run_network_linux_test.go:774:3: importShadow: shadow of imported from 'github.com/containerd/nerdctl/mod/tigron/expect' package 'expect' (gocritic)
		expect := test.Expect
		^
Error: cmd/nerdctl/container/container_run_test.go:553:2: importShadow: shadow of imported package 'bytes' (gocritic)
	bytes, err := os.ReadFile(filepath.Join(os.TempDir(), fmt.Sprintf("%s_%s.log", inspectedContainer.ID, "stdout")))
	^
Error: cmd/nerdctl/inspect/inspect.go:106:2: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/pkg/idutil/imagewalker' package 'imagewalker' (gocritic)
	imagewalker := &imagewalker.ImageWalker{
	^
Error: cmd/nerdctl/inspect/inspect.go:113:2: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/pkg/idutil/containerwalker' package 'containerwalker' (gocritic)
	containerwalker := &containerwalker.ContainerWalker{
	^
Error: pkg/bypass4netnsutil/bypass.go:36:38: importShadow: shadow of imported from 'github.com/rootless-containers/bypass4netns/pkg/api/daemon/client' package 'client' (gocritic)
func NewBypass4netnsCNIBypassManager(client client.Client, rlkClient rlkclient.Client, annotationsMap map[string]string) (*Bypass4netnsCNIBypassManager, error) {
                                     ^
Error: pkg/cmd/container/attach.go:155:3: importShadow: shadow of imported package 'io' (gocritic)
		io := task.IO()
		^
Error: pkg/cmd/container/create.go:157:3: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/pkg/cmd/image' package 'image' (gocritic)
		image := images[0].Name
		^
Error: pkg/cmd/container/kill.go:81:73: importShadow: shadow of imported from 'github.com/moby/sys/signal' package 'signal' (gocritic)
func killContainer(ctx context.Context, container containerd.Container, signal syscall.Signal) (err error) {
                                                                        ^
Error: pkg/cmd/container/list_util.go:35:48: importShadow: shadow of imported from 'github.com/containerd/containerd/v2/core/containers' package 'containers' (gocritic)
func foldContainerFilters(ctx context.Context, containers []containerd.Container, filters []string) (*containerFilterContext, error) {
                                               ^
Error: pkg/cmd/container/list_util.go:380:42: importShadow: shadow of imported from 'github.com/containerd/containerd/v2/core/containers' package 'containers' (gocritic)
func idOrNameFilter(ctx context.Context, containers []containerd.Container, value string) (*containers.Container, error) {
                                         ^
Error: pkg/cmd/container/run_mount.go:295:2: importShadow: shadow of imported from 'github.com/containerd/containerd/v2/core/containers' package 'containers' (gocritic)
	containers, err := client.Containers(ctx)
	^
Error: pkg/cmd/image/convert.go:85:2: importShadow: shadow of imported from 'github.com/containerd/stargz-snapshotter/estargz' package 'estargz' (gocritic)
	estargz := options.Estargz
	^
Error: pkg/cmd/image/convert.go:86:2: importShadow: shadow of imported from 'github.com/klauspost/compress/zstd' package 'zstd' (gocritic)
	zstd := options.Zstd
	^
Error: pkg/cmd/manifest/push.go:74:2: importShadow: shadow of imported from 'github.com/opencontainers/go-digest' package 'digest' (gocritic)
	digest, err := pushManifestList(ctx, resolver, parsedTargetRef, manifestList)
	^
Error: pkg/cmd/volume/create.go:39:2: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/pkg/labels' package 'labels' (gocritic)
	labels := strutil.DedupeStrSlice(options.Labels)
	^
Error: pkg/containerutil/container_network_manager.go:315:2: importShadow: shadow of imported from 'github.com/opencontainers/runtime-spec/specs-go' package 'specs' (gocritic)
	specs := []oci.SpecOpts{}
	^
Error: pkg/containerutil/container_network_manager.go:704:2: importShadow: shadow of imported from 'github.com/opencontainers/runtime-spec/specs-go' package 'specs' (gocritic)
	specs := []oci.SpecOpts{
	^
Error: pkg/containerutil/containerutil.go:308:3: importShadow: shadow of imported package 'io' (gocritic)
		io := task.IO()
		^
Error: pkg/idutil/imagewalker/imagewalker.go:86:2: importShadow: shadow of imported from 'github.com/containerd/containerd/v2/core/images' package 'images' (gocritic)
	images, err := w.Client.ImageService().List(ctx, filters...)
	^
Error: pkg/idutil/imagewalker/imagewalker.go:148:2: importShadow: shadow of imported from 'github.com/containerd/containerd/v2/core/images' package 'images' (gocritic)
	images, err := w.Client.ImageService().List(ctx, filters...)
	^
Error: pkg/imgutil/commit/commit.go:360:2: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/pkg/labels' package 'labels' (gocritic)
	labels := map[string]string{
	^
Error: pkg/infoutil/infoutil.go:53:2: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/pkg/version' package 'version' (gocritic)
	version, err := versionService.Version(ctx, &ptypes.Empty{})
	^
Error: pkg/infoutil/infoutil.go:226:2: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/pkg/version' package 'version' (gocritic)
	version := firstLine[2]
	^
Error: pkg/inspecttypes/dockercompat/dockercompat.go:687:44: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/pkg/labels' package 'labels' (gocritic)
func statusFromNative(x containerd.Status, labels map[string]string) string {
                                           ^
Error: pkg/ipfs/registry_ipfs.go:63:7: importShadow: shadow of imported from 'github.com/containerd/containerd/v2/core/content' package 'content' (gocritic)
	cid, content, mediaType, size, err := s.serve(r)
	     ^
Error: pkg/ipfs/registry_ipfs.go:97:17: importShadow: shadow of imported from 'github.com/containerd/containerd/v2/core/content' package 'content' (gocritic)
			resolvedCID, content, mediaType, size, err := s.serveContentByDigest(r.Context(), cidStr, ref)
			             ^
Error: pkg/ipfs/registry_ipfs.go:107:16: importShadow: shadow of imported from 'github.com/containerd/containerd/v2/core/content' package 'content' (gocritic)
		resolvedCID, content, mediaType, size, err := s.serveContentByCID(r.Context(), cidStr)
		             ^
Error: pkg/ipfs/registry_ipfs.go:117:16: importShadow: shadow of imported from 'github.com/containerd/containerd/v2/core/content' package 'content' (gocritic)
		resolvedCID, content, mediaType, size, err := s.serveContentByDigest(r.Context(), rootCIDStr, dgstStr)
		             ^
Error: pkg/logging/cri_logger.go:319:18: importShadow: shadow of imported from 'github.com/containerd/log' package 'log' (gocritic)
func ParseCRILog(log []byte, msg *logMessage) error {
                 ^
Error: pkg/netutil/netutil.go:330:32: importShadow: shadow of imported package 'net' (gocritic)
func (e *CNIEnv) RemoveNetwork(net *NetworkConfig) error {
                               ^
Error: pkg/netutil/netutil.go:435:53: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/pkg/labels' package 'labels' (gocritic)
func (e *CNIEnv) generateNetworkConfig(name string, labels []string, plugins []CNIPlugin) (*NetworkConfig, error) {
                                                    ^
Error: pkg/netutil/subnet/subnet_test.go:45:6: importShadow: shadow of imported package 'net' (gocritic)
		_, net, _ := net.ParseCIDR(tc.subnet)
		   ^
Error: pkg/ocihook/ocihook.go:71:6: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/pkg/ocihook/state' package 'state' (gocritic)
	var state specs.State
	    ^
Error: pkg/ocihook/ocihook.go:135:21: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/pkg/ocihook/state' package 'state' (gocritic)
func newHandlerOpts(state *specs.State, dataStore, cniPath, cniNetconfPath, bridgeIP string) (*handlerOpts, error) {
                    ^
Error: pkg/ocihook/ocihook.go:290:20: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/pkg/ocihook/state' package 'state' (gocritic)
func getExtraHosts(state *specs.State) (map[string]string, error) {
                   ^
Error: pkg/ocihook/ocihook.go:306:19: importShadow: shadow of imported from 'github.com/containerd/nerdctl/v2/pkg/ocihook/state' package 'state' (gocritic)
func getNetNSPath(state *specs.State) (string, error) {
                  ^
Error: pkg/rootlessutil/port_linux.go:30:32: importShadow: shadow of imported from 'github.com/rootless-containers/rootlesskit/v2/pkg/api/client' package 'client' (gocritic)
func NewRootlessCNIPortManager(client client.Client) (*RootlessCNIPortManager, error) {
                               ^
Error: pkg/snapshotterutil/sociutil.go:107:46: importShadow: shadow of imported from 'github.com/containerd/containerd/v2/client' package 'client' (gocritic)
func ConvertSociIndexV2(ctx context.Context, client *client.Client, srcRef string, destRef string, gOpts types.GlobalCommandOptions, platforms []string, sOpts types.SociOptions) (string, error) {
                                             ^
Error: cmd/nerdctl/builder/builder.go:160:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("context needs to be specified")
		       ^
Error: cmd/nerdctl/compose/compose_pause_linux_test.go:28:2: enforce-switch-style: switch must have a default case clause (revive)
	switch base.Info().CgroupDriver {
	case "none", "":
		t.Skip("requires cgroup (for pausing)")
	}
Error: cmd/nerdctl/compose/compose_run.go:162:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("--service-ports and --publish(-p) cannot exist simultaneously")
		       ^
Error: cmd/nerdctl/compose/compose_up.go:68:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("--abort-on-container-exit flag is incompatible with flag --detach")
		       ^
Error: cmd/nerdctl/container/container_cp_linux.go:105:38: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return types.ContainerCpOptions{}, fmt.Errorf("one of src or dest must be a local file specification")
		                                   ^
Error: cmd/nerdctl/container/container_cp_linux.go:108:38: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return types.ContainerCpOptions{}, fmt.Errorf("one of src or dest must be a container file specification")
		                                   ^
Error: cmd/nerdctl/container/container_cp_linux.go:111:38: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return types.ContainerCpOptions{}, fmt.Errorf("support for reading a tar archive from stdin is not implemented yet")
		                                   ^
Error: cmd/nerdctl/container/container_cp_linux.go:114:38: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return types.ContainerCpOptions{}, fmt.Errorf("support for writing a tar archive to stdout is not implemented yet")
		                                   ^
Error: cmd/nerdctl/container/container_create.go:36:2: enforce-switch-style: switch must have a default case clause (revive)
	switch runtime.GOOS {
	case "windows":
		longHelp += "\n"
		longHelp += "WARNING: `nerdctl create` is experimental on Windows and currently broken (https://github.com/containerd/nerdctl/issues/28)"
	case "freebsd":
		longHelp += "\n"
		longHelp += "WARNING: `nerdctl create` is experimental on FreeBSD and currently requires `--net=none` (https://github.com/containerd/nerdctl/blob/main/docs/freebsd.md)"
	}
Error: cmd/nerdctl/container/container_create.go:514:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return opt, fmt.Errorf("invalid user mode")
		            ^
Error: cmd/nerdctl/container/container_create.go:520:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return opt, fmt.Errorf("privileged flag cannot be used with userns-remap")
		            ^
Error: cmd/nerdctl/container/container_export.go:55:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("requires at least 1 argument")
		       ^
Error: cmd/nerdctl/container/container_export.go:79:11: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return fmt.Errorf("cowardly refusing to save to a terminal. Use the -o flag or redirect")
			       ^
Error: cmd/nerdctl/container/container_list_linux_test.go:667:3: unnecessary-format: unnecessary use of formatting function "t.Errorf", you can replace it with "t.Error" (revive)
		t.Errorf("expected containers in decending order")
		^
Error: cmd/nerdctl/container/container_run.go:54:2: enforce-switch-style: switch must have a default case clause (revive)
	switch runtime.GOOS {
	case "windows":
		longHelp += "\n"
		longHelp += "WARNING: `nerdctl run` is experimental on Windows and currently broken (https://github.com/containerd/nerdctl/issues/28)"
	case "freebsd":
		longHelp += "\n"
		longHelp += "WARNING: `nerdctl run` is experimental on FreeBSD and currently requires `--net=none` (https://github.com/containerd/nerdctl/blob/main/docs/freebsd.md)"
	}
Error: cmd/nerdctl/container/container_run.go:349:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return opt, fmt.Errorf("invalid stream specified with -a flag. Valid streams are STDIN, STDOUT, and STDERR")
		            ^
Error: cmd/nerdctl/container/container_run_cgroup_linux_test.go:53:2: enforce-switch-style: switch must have a default case clause (revive)
	switch info.CgroupDriver {
	case "none", "":
		t.Skip("test requires cgroup driver")
	}
Error: cmd/nerdctl/container/container_run_cgroup_linux_test.go:152:2: enforce-switch-style: switch must have a default case clause (revive)
	switch info.CgroupDriver {
	case "none", "":
		t.Skip("test requires cgroup driver")
	}
Error: cmd/nerdctl/container/container_run_cgroup_linux_test.go:195:2: enforce-switch-style: switch must have a default case clause (revive)
	switch info.CgroupDriver {
	case "none", "":
		t.Skip("test requires cgroup driver")
	}
Error: cmd/nerdctl/container/container_run_cgroup_linux_test.go:402:2: enforce-switch-style: switch must have a default case clause (revive)
	switch info.CgroupDriver {
	case "none", "":
		t.Skip("test requires cgroup driver")
	}
Error: cmd/nerdctl/container/container_run_cgroup_linux_test.go:417:2: enforce-switch-style: switch must have a default case clause (revive)
	switch info.CgroupDriver {
	case "none", "":
		t.Skip("test requires cgroup driver")
	}
Error: cmd/nerdctl/container/container_run_cgroup_linux_test.go:476:2: enforce-switch-style: switch must have a default case clause (revive)
	switch info.CgroupDriver {
	case "none", "":
		t.Skip("test requires cgroup driver")
	}
Error: cmd/nerdctl/container/container_run_log_driver_syslog_test.go:45:3: unnecessary-format: unnecessary use of formatting function "t.Fatalf", you can replace it with "t.Fatal" (revive)
		t.Fatalf("Error retrieving hostname")
		^
Error: cmd/nerdctl/container/container_run_restart_linux_test.go:41:3: unnecessary-format: unnecessary use of formatting function "t.Skipf", you can replace it with "t.Skip" (revive)
		t.Skipf("test is long")
		^
Error: cmd/nerdctl/container/container_run_restart_linux_test.go:91:2: unnecessary-format: unnecessary use of formatting function "t.Fatalf", you can replace it with "t.Fatal" (revive)
	t.Fatalf("the container does not seem to be restarted")
	^
Error: cmd/nerdctl/container/container_run_test.go:587:11: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return fmt.Errorf("host not found")
			       ^
Error: cmd/nerdctl/container/container_top.go:59:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("top requires cgroup v2 for rootless containers, see https://rootlesscontaine.rs/getting-started/common/cgroup2/")
		       ^
Error: cmd/nerdctl/container/container_update.go:174:21: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
				return options, fmt.Errorf("minimum memoryswap limit should be larger than memory limit, see usage")
				                ^
Error: cmd/nerdctl/container/container_update.go:195:19: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return options, fmt.Errorf("minimum memory limit can not be less than memory reservation limit, see usage")
		                ^
Error: cmd/nerdctl/container/container_update.go:222:19: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return options, fmt.Errorf("kernel support for cgroup blkio weight missing, weight discarded")
		                ^
Error: cmd/nerdctl/helpers/flagutil.go:60:11: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return fmt.Errorf("--no-healthcheck conflicts with --health-* options")
			       ^
Error: cmd/nerdctl/helpers/flagutil.go:66:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("--health-interval cannot be negative")
		       ^
Error: cmd/nerdctl/helpers/flagutil.go:69:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("--health-timeout cannot be negative")
		       ^
Error: cmd/nerdctl/helpers/flagutil.go:72:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("--health-retries cannot be negative")
		       ^
Error: cmd/nerdctl/helpers/flagutil.go:75:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("--health-start-period cannot be negative")
		       ^
Error: cmd/nerdctl/helpers/flagutil.go:78:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("--health-start-interval cannot be negative")
		       ^
Error: cmd/nerdctl/image/image_history.go:118:14: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
						return fmt.Errorf("too many non-empty layers in History section")
						       ^
Error: cmd/nerdctl/image/image_save.go:96:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("cowardly refusing to save to a terminal. Use the -o flag or redirect")
		       ^
Error: cmd/nerdctl/main_linux.go:41:2: enforce-switch-style: switch must have a default case clause (revive)
	switch commands[1] {
	// completion, login, logout, version: false, because it shouldn't require the daemon to be running
	// apparmor: false, because it requires the initial mount namespace to access /sys/kernel/security
	// cp, compose cp: false, because it requires the initial mount namespace to inspect file owners
	case "", "completion", "login", "logout", "apparmor", "cp", "version":
		return false
	case "container":
		if len(commands) < 3 {
			return true
		}
		switch commands[2] {
		case "cp":
			return false
		}
	case "compose":
		if len(commands) < 3 {
			return true
		}
		switch commands[2] {
		case "cp":
			return false
		}
	}
Error: cmd/nerdctl/main_linux.go:51:3: enforce-switch-style: switch must have a default case clause (revive)
		switch commands[2] {
		case "cp":
			return false
		}
Error: cmd/nerdctl/main_linux.go:59:3: enforce-switch-style: switch must have a default case clause (revive)
		switch commands[2] {
		case "cp":
			return false
		}
Error: pkg/api/types/cri/metadata_types.go:69:2: enforce-switch-style: switch must have a default case clause (revive)
	switch versioned.Version {
	case metadataVersion:
		*c = ContainerMetadata(versioned.Metadata)
		return nil
	}
Error: pkg/api/types/namespace_types.go:17:9: var-naming: avoid meaningless package names (revive)
package types
        ^
Error: pkg/buildkitutil/buildkitutil.go:108:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, fmt.Errorf("no worker available")
		            ^
Error: pkg/buildkitutil/buildkitutil.go:116:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, fmt.Errorf("worker doesn't have labels")
		            ^
Error: pkg/buildkitutil/buildkitutil_unix.go:28:22: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return []string{}, fmt.Errorf("namespace must be specified")
		                   ^
Error: pkg/cmd/builder/build.go:388:3: enforce-switch-style: switch must have a default case clause (revive)
		switch *options.Pull {
		case true:
			buildctlArgs = append(buildctlArgs, "--opt=image-resolve-mode=pull")
		case false:
			buildctlArgs = append(buildctlArgs, "--opt=image-resolve-mode=local")
		}
Error: pkg/cmd/builder/build.go:410:43: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
					return "", nil, false, "", nil, nil, fmt.Errorf("invalid value for attribute \"disabled\"")
					                                     ^
Error: pkg/cmd/builder/build.go:419:41: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return "", nil, false, "", nil, nil, fmt.Errorf("attestation type not specified")
			                                     ^
Error: pkg/cmd/container/commit.go:93:29: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return commit.Changes{}, fmt.Errorf("received an empty value in change flag")
			                         ^
Error: pkg/cmd/container/create_userns_opts_linux.go:157:14: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return "", fmt.Errorf("only one network namespace is supported")
		           ^
Error: pkg/cmd/container/create_userns_opts_linux.go:176:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return "", fmt.Errorf("EvalSymlinks: too many links")
			           ^
Error: pkg/cmd/container/create_userns_opts_linux.go:184:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return "", fmt.Errorf("EvalSymlinks: too many links")
			           ^
Error: pkg/cmd/container/create_userns_opts_linux.go:194:14: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return "", fmt.Errorf("path is not of the form /proc/<pid>/ns/net, unable to resolve user namespace")
		           ^
Error: pkg/cmd/container/export.go:37:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("export command is not supported on Windows")
		       ^
Error: pkg/cmd/container/health_check.go:45:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("container has no health check configured")
		       ^
Error: pkg/cmd/container/health_check.go:55:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("health check configuration has no test")
		       ^
Error: pkg/cmd/container/list.go:90:21: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return nil, nil, fmt.Errorf("container id is nill")
			                 ^
Error: pkg/cmd/container/logs.go:48:2: enforce-switch-style: switch must have a default case clause (revive)
	switch options.GOptions.Namespace {
	case "moby":
		log.G(ctx).Warn("Currently, `nerdctl logs` only supports containers created with `nerdctl run -d` or CRI")
	}
Error: pkg/cmd/container/run_cgroup_linux.go:144:17: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
				return nil, fmt.Errorf("minimum memoryswap limit should be larger than memory limit, see usage")
				            ^
Error: pkg/cmd/container/run_cgroup_linux.go:159:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, fmt.Errorf("minimum memory limit can not be less than memory reservation limit, see usage")
		            ^
Error: pkg/cmd/container/run_linux.go:198:20: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return nil, "", fmt.Errorf("invalid pid namespace. Set --pid=[host|container:<name|id>")
			                ^
Error: pkg/cmd/container/run_mount.go:250:3: enforce-switch-style: switch must have a default case clause (revive)
		switch imgVol {
		case "/", "/dev", "/sys", "proc":
			return nil, nil, nil, fmt.Errorf("invalid VOLUME: %q", imgVolRaw)
		}
Error: pkg/cmd/container/run_restart.go:32:2: enforce-switch-style: switch must have a default case clause (revive)
	switch policySlice[0] {
	case "", "no":
		return true, nil
	}
Error: pkg/cmd/container/run_restart.go:41:17: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return false, fmt.Errorf("no restart plugin found")
		              ^
Error: pkg/cmd/container/run_restart.go:102:4: enforce-switch-style: switch must have a default case clause (revive)
			switch status.Status {
			case containerd.Stopped:
				desireStatus = containerd.Stopped
			case containerd.Created:
				desireStatus = containerd.Created
			}
Error: pkg/cmd/container/start.go:33:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("you cannot start and attach multiple containers at once")
		       ^
Error: pkg/cmd/container/stats_linux.go:171:18: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
				return 0, 0, fmt.Errorf("invalid number of cpu fields")
				             ^
Error: pkg/cmd/container/top_unix.go:175:3: enforce-switch-style: switch must have a default case clause (revive)
		switch r {
		case '\t', '\n', '\f', '\r', ' ':
			return true
		}
Error: pkg/cmd/container/top_unix.go:209:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, fmt.Errorf("couldn't find PID field in ps output")
		            ^
Error: pkg/cmd/image/convert.go:119:3: enforce-switch-style: switch must have a default case clause (revive)
		switch {
		case estargz:
			convertFunc, finalize, err = getESGZConverter(options)
			if err != nil {
				return err
			}
			convertType = "estargz"
		case zstd:
			convertFunc, err = getZstdConverter(options)
			if err != nil {
				return err
			}
			convertType = "zstd"
		case zstdchunked:
			convertFunc, err = getZstdchunkedConverter(options)
			if err != nil {
				return err
			}
			convertType = "zstdchunked"
		case overlaybd:
			obdOpts, err := getOBDConvertOpts(options)
			if err != nil {
				return err
			}
			obdOpts = append(obdOpts, overlaybdconvert.WithClient(client))
			obdOpts = append(obdOpts, overlaybdconvert.WithImageRef(srcRef))
			convertFunc = overlaybdconvert.IndexConvertFunc(obdOpts...)
			convertOpts = append(convertOpts, converter.WithIndexConvertFunc(convertFunc))
			convertType = "overlaybd"
		case nydus:
			nydusOpts, err := getNydusConvertOpts(options)
			if err != nil {
				return err
			}
			convertHooks := converter.ConvertHooks{
				PostConvertHook: nydusconvert.ConvertHookFunc(nydusconvert.MergeOption{
					WorkDir:          nydusOpts.WorkDir,
					BuilderPath:      nydusOpts.BuilderPath,
					FsVersion:        nydusOpts.FsVersion,
					ChunkDictPath:    nydusOpts.ChunkDictPath,
					PrefetchPatterns: nydusOpts.PrefetchPatterns,
					OCI:              true,
				}),
			}
			convertOpts = append(convertOpts, converter.WithIndexConvertFunc(
				converter.IndexConvertFuncWithHook(
					nydusconvert.LayerConvertFunc(*nydusOpts),
					true,
					platMC,
					convertHooks,
				)),
			)
			convertType = "nydus"
		case soci:
			// Convert image to SOCI format
			convertedRef, err := snapshotterutil.ConvertSociIndexV2(ctx, client, srcRef, targetRef, options.GOptions, options.Platforms, options.SociOptions)
			if err != nil {
				return fmt.Errorf("failed to convert image to SOCI format: %w", err)
			}
			res := converterutil.ConvertedImageInfo{
				Image: convertedRef,
			}
			return printConvertedImage(options.Stdout, options, res)
		}
Error: pkg/cmd/image/convert.go:237:20: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, nil, fmt.Errorf("estargz-external-toc requires experimental mode to be enabled")
		                 ^
Error: pkg/cmd/image/convert.go:240:20: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, nil, fmt.Errorf("option --estargz-keep-diff-id must be specified with --estargz-external-toc")
		                 ^
Error: pkg/cmd/image/convert.go:276:16: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return nil, fmt.Errorf("estargz-record-in requires experimental mode to be enabled")
			            ^
Error: pkg/cmd/image/convert.go:303:16: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return nil, fmt.Errorf("zstdchunked-record-in requires experimental mode to be enabled")
			            ^
Error: pkg/cmd/image/import.go:65:16: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return zero, fmt.Errorf("no input stream provided")
		             ^
Error: pkg/cmd/manifest/create.go:47:14: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return "", fmt.Errorf("refusing to amend an existing manifest list with no --amend flag")
		           ^
Error: pkg/cmd/manifest/inspect.go:59:16: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return nil, fmt.Errorf("expected ocispec.Index for OCI index")
			            ^
Error: pkg/cmd/manifest/inspect.go:66:16: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return nil, fmt.Errorf("expected DockerManifestListStruct for Docker manifest list")
			            ^
Error: pkg/cmd/manifest/push.go:92:46: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return manifesttypes.DockerManifestList{}, fmt.Errorf("no manifests to build list from")
		                                           ^
Error: pkg/cmd/network/create.go:32:11: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return fmt.Errorf("cannot set gateway or ip-range without subnet, specify --subnet manually")
			       ^
Error: pkg/cmd/network/inspect.go:88:3: enforce-switch-style: switch must have a default case clause (revive)
		switch options.Mode {
		case "native":
			result = append(result, r)
		case "dockercompat":
			compat, err := dockercompat.NetworkFromNative(r)
			if err != nil {
				return err
			}
			result = append(result, compat)
		}
Error: pkg/cmd/network/list.go:155:4: enforce-switch-style: switch must have a default case clause (revive)
			switch filter {
			case "name":
				re, err := regexp.Compile(value)
				if err != nil {
					return nil, nil, err
				}
				nameFilterFuncs = append(nameFilterFuncs, func(name string) bool {
					return re.MatchString(name)
				})
			case "label":
				k, v, hasValue := strings.Cut(value, "=")
				labelFilterFuncs = append(labelFilterFuncs, func(labels *map[string]string) bool {
					if labels == nil {
						return false
					}
					val, ok := (*labels)[k]
					if !ok || (hasValue && val != v) {
						return false
					}
					return true
				})
			}
Error: pkg/cmd/system/events.go:84:2: enforce-switch-style: switch must have a default case clause (revive)
	switch strings.ToUpper(filter) {
	case "EVENT", "STATUS":
		return func(e *EventOut) bool {
			if !isStatus(string(e.Status)) {
				return false
			}

			return strings.EqualFold(string(e.Status), filterValue)
		}, nil
	}
Error: pkg/cmd/system/info.go:94:2: enforce-switch-style: switch must have a default case clause (revive)
	switch options.Mode {
	case "native":
		return prettyPrintInfoNative(options.Stdout, infoNative)
	case "dockercompat":
		return prettyPrintInfoDockerCompat(options.Stdout, options.Stderr, infoCompat, options.GOptions)
	}
Error: pkg/cmd/system/info.go:140:2: unnecessary-format: unnecessary use of formatting function "fmt.Fprintf", you can replace it with "fmt.Fprint" (revive)
	fmt.Fprintf(w, "containerd Plugins (disabled):\n")
	^
Error: pkg/cmd/system/info.go:150:2: unnecessary-format: unnecessary use of formatting function "fmt.Fprintf", you can replace it with "fmt.Fprint" (revive)
	fmt.Fprintf(w, "Client:\n")
	^
Error: pkg/cmd/system/info.go:154:2: unnecessary-format: unnecessary use of formatting function "fmt.Fprintf", you can replace it with "fmt.Fprint" (revive)
	fmt.Fprintf(w, "Server:\n")
	^
Error: pkg/cmd/system/info.go:161:2: unnecessary-format: unnecessary use of formatting function "fmt.Fprintf", you can replace it with "fmt.Fprint" (revive)
	fmt.Fprintf(w, " Plugins:\n")
	^
Error: pkg/cmd/system/info.go:196:2: unnecessary-format: unnecessary use of formatting function "fmt.Fprintf", you can replace it with "fmt.Fprint" (revive)
	fmt.Fprintf(w, " Security Options:\n")
	^
Error: pkg/cmd/volume/list.go:224:4: enforce-switch-style: switch must have a default case clause (revive)
			switch filter {
			case "name":
				re, err := regexp.Compile(value)
				if err != nil {
					return nil, nil, nil, false, err
				}
				nameFilterFuncs = append(nameFilterFuncs, func(name string) bool {
					return re.MatchString(name)
				})
			case "label":
				k, v, hasValue := strings.Cut(value, "=")
				labelFilterFuncs = append(labelFilterFuncs, func(labels *map[string]string) bool {
					if labels == nil {
						return false
					}
					val, ok := (*labels)[k]
					if !ok || (hasValue && val != v) {
						return false
					}
					return true
				})
			}
Error: pkg/composer/create.go:204:14: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return "", fmt.Errorf("currently StdinOpen(-i) and Tty(-t) should be same")
		           ^
Error: pkg/composer/pipetagger/pipetagger.go:58:2: enforce-switch-style: switch must have a default case clause (revive)
	switch fgAttr {
	case color.FgBlack:
		attrs = append(attrs, color.BgWhite)
	case color.FgWhite:
		attrs = append(attrs, color.BgBlack)
	case color.FgHiBlack:
		attrs = append(attrs, color.BgHiWhite)
	case color.FgHiWhite:
		attrs = append(attrs, color.BgHiBlack)
	}
Error: pkg/composer/serviceparser/serviceparser.go:345:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return "", fmt.Errorf("deploy.restart_policy.condition: \"always\" is invalid, did you mean \"any\"?")
			           ^
Error: pkg/composer/serviceparser/serviceparser.go:349:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return "", fmt.Errorf("deploy.restart_policy.condition: \"no\" is invalid, did you mean \"none\"?")
			           ^
Error: pkg/composer/serviceparser/serviceparser.go:607:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, fmt.Errorf("conflicting options: hostname and container network mode")
		            ^
Error: pkg/composer/up_service.go:138:14: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return "", fmt.Errorf("currently StdinOpen(-i) and Tty(-t) should be same")
		           ^
Error: pkg/config/config.go:42:28: struct-tag: unknown option " omitempty" in toml tag (revive)
	BridgeIP         string   `toml:"bridge_ip, omitempty"`
	                          ^
Error: pkg/config/config.go:45:28: struct-tag: unknown option " omitempty" in toml tag (revive)
	UsernsRemap      string   `toml:"userns_remap, omitempty"`
	                          ^
Error: pkg/containerutil/container_network_manager.go:463:16: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return opts, fmt.Errorf("conflicting options: exactly one network specification is allowed when using '--network=container:<container>'")
		             ^
Error: pkg/containerutil/container_network_manager.go:806:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("conflicting options: cannot set --hostname and/or --domainname with --uts=host")
		       ^
Error: pkg/containerutil/container_network_manager.go:819:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, fmt.Errorf("container ID is required for setting up hostname file")
		            ^
Error: pkg/containerutil/container_network_manager.go:873:16: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return opts, fmt.Errorf("cannot determine networking options from nil spec")
		             ^
Error: pkg/containerutil/container_network_manager.go:876:16: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return opts, fmt.Errorf("cannot determine networking options from nil spec.Annotations")
		             ^
Error: pkg/containerutil/containerutil.go:177:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, fmt.Errorf("shared container is not running")
		            ^
Error: pkg/dnsutil/hostsstore/hosts.go:59:4: enforce-switch-style: switch must have a default case clause (revive)
			switch com {
			case MarkerBegin:
				skip = true
			case MarkerEnd:
				sawMarkerEnd = true
			}
Error: pkg/flagutil/flagutil_test.go:208:11: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			err:   fmt.Errorf("invalid environment variable: =a"),
			       ^
Error: pkg/flagutil/flagutil_test.go:244:11: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			err:   fmt.Errorf("invalid environment variable: ="),
			       ^
Error: pkg/healthcheck/executor.go:179:16: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return nil, fmt.Errorf("no health check command specified")
			            ^
Error: pkg/healthcheck/executor.go:187:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, fmt.Errorf("no health check command specified")
		            ^
Error: pkg/imgutil/commit/commit.go:435:51: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return ocispec.Descriptor{}, digest.Digest(""), fmt.Errorf("invalid differ response with no diffID")
		                                                ^
Error: pkg/imgutil/commit/commit.go:471:53: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
				return ocispec.Descriptor{}, digest.Digest(""), fmt.Errorf("invalid differ response with no diffID")
				                                                ^
Error: pkg/imgutil/commit/commit.go:509:53: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
				return ocispec.Descriptor{}, digest.Digest(""), fmt.Errorf("invalid differ response with no diffID")
				                                                ^
Error: pkg/imgutil/imgutil.go:222:16: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return nil, fmt.Errorf("unpacking requires a single platform to be specified (e.g., --platform=amd64)")
			            ^
Error: pkg/infoutil/infoutil.go:235:3: enforce-switch-style: switch must have a default case clause (revive)
		switch strings.TrimSpace(detail[0]) {
		case "commit":
			details["GitCommit"] = strings.TrimSpace(detail[1])
		}
Error: pkg/infoutil/infoutil_unix.go:80:3: enforce-switch-style: switch must have a default case clause (revive)
		switch k {
		case "PRETTY_NAME":
			return v
		case "NAME":
			name = v
		case "VERSION":
			version = v
		}
Error: pkg/inspecttypes/dockercompat/dockercompat.go:1036:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("spec cannot be nil")
		       ^
Error: pkg/inspecttypes/dockercompat/dockercompat.go:1039:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("hostConfig cannot be nil")
		       ^
Error: pkg/ipcutil/ipcutil.go:80:16: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return res, fmt.Errorf("invalid ipc namespace. Set --ipc=[host|container:<name|id>")
			            ^
Error: pkg/ipcutil/ipcutil.go:140:2: enforce-switch-style: switch must have a default case clause (revive)
	switch ipc.Mode {
	case Private:
		// If nothing is specified, or if private, default to normal behavior
		if len(ipc.ShmSize) > 0 {
			shmBytes, err := units.RAMInBytes(ipc.ShmSize)
			if err != nil {
				return nil, err
			}
			opts = append(opts, oci.WithDevShmSize(shmBytes/1024))
		}
	case Host:
		opts = append(opts, withBindMountHostIPC)
		if runtime.GOOS != "windows" {
			opts = append(opts, oci.WithHostNamespace(specs.IPCNamespace))
		}
	case Shareable:
		if ipc.HostShmPath == nil {
			return nil, errors.New("ipc mode is shareable, but host shm path is nil")
		}
		err := makeShareableDevshm(*ipc.HostShmPath, ipc.ShmSize)
		if err != nil {
			return nil, err
		}
		opts = append(opts, withBindMountHostOtherSourceIPC(*ipc.HostShmPath))
	case Container:
		if ipc.VictimContainerID == nil {
			return nil, errors.New("ipc mode is container, but victim container id is nil")
		}
		targetCon, err := client.LoadContainer(ctx, *ipc.VictimContainerID)
		if err != nil {
			return nil, err
		}

		task, err := targetCon.Task(ctx, nil)
		if err != nil {
			return nil, err
		}

		status, err := task.Status(ctx)
		if err != nil {
			return nil, err
		}

		if status.Status != containerd.Running {
			return nil, fmt.Errorf("shared container is not running")
		}

		targetConLabels, err := targetCon.Labels(ctx)
		if err != nil {
			return nil, err
		}

		targetConIPC, err := DecodeIPCLabel(targetConLabels[labels.IPC])
		if err != nil {
			return nil, err
		}

		if targetConIPC.Mode == Host {
			opts = append(opts, oci.WithHostNamespace(specs.IPCNamespace))
			opts = append(opts, withBindMountHostIPC)
			return opts, nil
		} else if targetConIPC.Mode != Shareable {
			return nil, errors.New("victim container's ipc mode is not shareable")
		}

		if targetConIPC.HostShmPath == nil {
			return nil, errors.New("victim container's host shm path is nil")
		}

		opts = append(opts, withBindMountHostOtherSourceIPC(*targetConIPC.HostShmPath))
	}
Error: pkg/ipcutil/ipcutil.go:184:16: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return nil, fmt.Errorf("shared container is not running")
			            ^
Error: pkg/ipcutil/ipcutil.go:237:3: enforce-switch-style: switch must have a default case clause (revive)
		switch p := path.Clean(m.Destination); p {
		case "/dev/shm", "/dev/mqueue":
			s.Mounts[i] = specs.Mount{
				Destination: p,
				Type:        "bind",
				Source:      p,
				Options:     []string{"rbind", "nosuid", "noexec", "nodev"},
			}
		}
Error: pkg/ipfs/registry_ipfs.go:86:26: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return "", nil, "", 0, fmt.Errorf("unsupported method")
		                       ^
Error: pkg/ipfs/registry_ipfs.go:125:25: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
	return "", nil, "", 0, fmt.Errorf("unsupported path")
	                       ^
Error: pkg/ipfs/registry_ipfs.go:216:36: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return "", ocispec.Descriptor{}, fmt.Errorf("blob doesn't match")
		                                 ^
Error: pkg/ipfs/registry_ipfs.go:237:36: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return "", ocispec.Descriptor{}, fmt.Errorf("not found")
		                                 ^
Error: pkg/ipfs/registry_ipfs.go:321:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, fmt.Errorf("unexpected content")
		            ^
Error: pkg/logging/cri_logger.go:79:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("logpath is nil ")
		       ^
Error: pkg/logging/cri_logger.go:324:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("timestamp is not found")
		       ^
Error: pkg/logging/cri_logger.go:335:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("stream type is not found")
		       ^
Error: pkg/logging/cri_logger.go:346:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("log tag is not found")
		       ^
Error: pkg/logging/cri_logger_test.go:41:3: unnecessary-format: unnecessary use of formatting function "t.Fatalf", you can replace it with "t.Fatal" (revive)
		t.Fatalf("unable to create temp file")
		^
Error: pkg/logging/cri_logger_test.go:179:3: unnecessary-format: unnecessary use of formatting function "t.Fatalf", you can replace it with "t.Fatal" (revive)
		t.Fatalf("unable to create temp file")
		^
Error: pkg/logging/fluentd_logger.go:106:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("logging to fluentd is not supported on windows")
		       ^
Error: pkg/logging/fluentd_logger.go:165:16: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return nil, fmt.Errorf("unix socket path must not be empty")
			            ^
Error: pkg/logging/journald_logger.go:200:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("`journalctl` executable could not be found in PATH, cannot use Journald to view logs")
		       ^
Error: pkg/logging/json_logger.go:104:11: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return fmt.Errorf("max-size must be a positive number")
			       ^
Error: pkg/logging/json_logger.go:116:11: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return fmt.Errorf("max-file cannot be less than 1")
			       ^
Error: pkg/logging/json_logger_test.go:115:3: unnecessary-format: unnecessary use of formatting function "t.Fatalf", you can replace it with "t.Fatal" (revive)
		t.Fatalf("unable to create temp file")
		^
Error: pkg/logging/log_viewer.go:141:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, fmt.Errorf("the `cri` log viewer requires nerdctl to be running in experimental mode")
		            ^
Error: pkg/logging/log_viewer.go:145:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, fmt.Errorf("log type `none` was selected, nothing to log")
		            ^
Error: pkg/logging/logging.go:347:18: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return false, fmt.Errorf("context cancelled")
			              ^
Error: pkg/manifestutil/manifestutils.go:209:2: enforce-switch-style: switch must have a default case clause (revive)
	switch fieldName {
	case "SchemaV2Manifest":
		entry.SchemaV2Manifest = manifest
	case "OCIManifest":
		entry.OCIManifest = manifest
	}
Error: pkg/mountutil/mountutil.go:135:4: enforce-switch-style: switch must have a default case clause (revive)
			switch opt {
			case "rbind", "bind":
				fstype = "bind"
				found = true
			}
Error: pkg/mountutil/mountutil_linux.go:324:4: enforce-switch-style: switch must have a default case clause (revive)
			switch key {
			case "readonly", "ro", "rw", "rro":
				rwOption = key
				continue
			case "bind-nonrecursive":
				bindNonRecursive = true
				continue
			}
Error: pkg/mountutil/mountutil_linux.go:398:2: enforce-switch-style: switch must have a default case clause (revive)
	switch mountType {
	case Tmpfs:
		fields = []string{dst}
		if tmpfsMode != 0 {
			options = append(options, fmt.Sprintf("mode=%o", tmpfsMode))
		}
		if tmpfsSize > 0 {
			options = append(options, getTmpfsSize(tmpfsSize))
		}
	case Volume, Bind:
		fields = []string{src, dst}
		if bindPropagation != "" {
			options = append(options, bindPropagation)
		}
		if mountType == Bind {
			if bindNonRecursive {
				options = append(options, "bind")
			} else {
				options = append(options, "rbind")
			}
		}
	}
Error: pkg/mountutil/mountutil_linux.go:429:2: enforce-switch-style: switch must have a default case clause (revive)
	switch mountType {
	case Tmpfs:
		return ProcessFlagTmpfs(fieldsStr)
	case Volume, Bind:
		// createDir=false for --mount option to disallow creating directories on host if not found
		return ProcessFlagV(fieldsStr, volStore, false)
	}
Error: pkg/netutil/netutil_unix.go:275:17: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
				return nil, fmt.Errorf("ipam option must have a type (provide or request)")
				            ^
Error: pkg/netutil/networkstore/networkstore.go:45:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, fmt.Errorf("either dataStore or namespace or containerID is empty")
		            ^
Error: pkg/netutil/subnet/subnet.go:58:14: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
	return nil, fmt.Errorf("could not find free subnet")
	            ^
Error: pkg/netutil/subnet/subnet.go:81:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("no more subnets left")
		       ^
Error: pkg/platformutil/binfmt.go:28:2: enforce-switch-style: switch must have a default case clause (revive)
	switch ociArch {
	case "amd64":
		return "x86_64", nil
	case "arm64":
		return "aarch64", nil
	case "386":
		return "i386", nil
	case "arm", "s390x", "ppc64le", "riscv64", "mips64":
		return ociArch, nil
	case "mips64le":
		return "mips64el", nil // NOT typo
	case "loong64":
		return "loongarch64", nil // NOT typo
	}
Error: pkg/reflectutil/reflectutil.go:58:2: enforce-switch-style: switch must have a default case clause (revive)
	switch v.Kind() {
	case reflect.Map, reflect.Slice:
		return v.Len() == 0
	}
Error: pkg/resolvconf/resolvconf_linux_test.go:38:3: unnecessary-format: unnecessary use of formatting function "t.Fatalf", you can replace it with "t.Fatal" (revive)
		t.Fatalf("/etc/resolv.conf and GetResolvConf have different content.")
		^
Error: pkg/resolvconf/resolvconf_linux_test.go:45:3: unnecessary-format: unnecessary use of formatting function "t.Fatalf", you can replace it with "t.Fatal" (revive)
		t.Fatalf("/etc/resolv.conf and GetResolvConf have different hashes.")
		^
Error: pkg/signutil/signutil.go:33:11: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return fmt.Errorf("cosign only work with enable experimental feature")
			       ^
Error: pkg/signutil/signutil.go:41:11: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return fmt.Errorf("notation only work with enable experimental feature")
			       ^
Error: pkg/signutil/signutil.go:60:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return "", fmt.Errorf("cosign only work with enable experimental feature")
			           ^
Error: pkg/signutil/signutil.go:68:15: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
			return "", fmt.Errorf("notation only work with enable experimental feature")
			           ^
Error: pkg/snapshotterutil/socisource.go:73:4: enforce-switch-style: switch must have a default case clause (revive)
			switch desc.MediaType {
			case ocispec.MediaTypeImageManifest, images.MediaTypeDockerSchema2Manifest:
				for i := range children {
					c := &children[i]
					if images.IsLayerType(c.MediaType) {
						if c.Annotations == nil {
							c.Annotations = make(map[string]string)
						}

						c.Annotations[TargetSizeLabel] = fmt.Sprintf("%d", c.Size)
						c.Annotations[TargetSociIndexDigestLabel] = indexDigest

						remainingLayerDigestsCount := len(strings.Split(c.Annotations[ctdsnapshotters.TargetImageLayersLabel], ","))

						var layerSizes string
						/*
							We must ensure that the counts of layer sizes and layer digests are equal.
							We will limit the # of neighboring label sizes to equal the # of neighboring
							layer digests for any given layer.
						*/
						for _, l := range children[i : i+remainingLayerDigestsCount] {
							if images.IsLayerType(l.MediaType) {
								ls := fmt.Sprintf("%d,", l.Size)
								// This avoids the label hits the size limitation.
								// Skipping layers is allowed here and only affects performance.
								if err := labels.Validate(targetImageLayersSizeLabel, layerSizes+ls); err != nil {
									break
								}
								layerSizes += ls
							}
						}
						c.Annotations[targetImageLayersSizeLabel] = strings.TrimSuffix(layerSizes, ",")
					}
				}
			}
Error: pkg/statsutil/stats_linux.go:173:3: enforce-switch-style: switch must have a default case clause (revive)
		switch bioEntry.Op[0] {
		case 'r', 'R':
			blkRead = blkRead + bioEntry.Value
		case 'w', 'W':
			blkWrite = blkWrite + bioEntry.Value
		}
Error: pkg/store/filestore.go:44:47: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, errors.Join(ErrInvalidArgument, fmt.Errorf("FileStore rootPath cannot be empty"))
		                                            ^
Error: pkg/store/filestore.go:119:52: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, errors.Join(ErrFaultyImplementation, fmt.Errorf("operations on the store must use locking"))
		                                                 ^
Error: pkg/store/filestore.go:170:47: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return errors.Join(ErrFaultyImplementation, fmt.Errorf("operations on the store must use locking"))
		                                            ^
Error: pkg/store/filestore.go:205:52: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return nil, errors.Join(ErrFaultyImplementation, fmt.Errorf("operations on the store must use locking"))
		                                                 ^
Error: pkg/store/filestore.go:245:47: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return errors.Join(ErrFaultyImplementation, fmt.Errorf("operations on the store must use locking"))
		                                            ^
Error: pkg/store/filestore.go:280:47: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return errors.Join(ErrFaultyImplementation, fmt.Errorf("operations on the store must use locking"))
		                                            ^
Error: pkg/store/filestore.go:298:50: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return 0, errors.Join(ErrFaultyImplementation, fmt.Errorf("operations on the store must use locking"))
		                                               ^
Error: pkg/tabutil/tabutil.go:44:10: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
		return fmt.Errorf("no header")
		       ^
Error: pkg/tarutil/tarutil.go:56:20: unnecessary-format: unnecessary use of formatting function "fmt.Errorf", you can replace it with "errors.New" (revive)
	return "", false, fmt.Errorf("failed to find `tar` binary")
	                  ^
Error: pkg/testutil/iptables/iptables_linux.go:95:3: unnecessary-format: unnecessary use of formatting function "t.Logf", you can replace it with "t.Log" (revive)
		t.Logf("no redirectced chain found")
		^
Error: pkg/testutil/nerdtest/requirements.go:176:3: enforce-switch-style: switch must have a default case clause (revive)
		switch dinf.CgroupDriver {
		case "none", "":
			ret = false
			mess = "cgroup is none"
		}
Error: pkg/testutil/nerdtest/requirements.go:211:3: enforce-switch-style: switch must have a default case clause (revive)
		switch dinf.CgroupDriver {
		case "none", "":
			ret = false
			mess = "cgroup is none"
		}
Error: pkg/testutil/testsyslog/testsyslog.go:60:4: unnecessary-format: unnecessary use of formatting function "log.Fatalf", you can replace it with "log.Fatal" (revive)
			log.Fatalf("certificates required.")
			^
Error: pkg/testutil/testsyslog/testsyslog.go:64:4: unnecessary-format: unnecessary use of formatting function "log.Fatalf", you can replace it with "log.Fatal" (revive)
			log.Fatalf("certificates is nil")
			^
Error: pkg/testutil/testsyslog/testsyslog.go:91:2: enforce-switch-style: switch must have a default case clause (revive)
	switch network {
	case "unix", "unixgram":
		switch runtime.GOOS {
		case "darwin":
			switch runtime.GOARCH {
			case "arm", "arm64":
				return false
			}
		case "windows":
			return false
		}
	case "udp", "tcp", "tcp+tls":
		return !rootlessutil.IsRootless()
	}
Error: pkg/testutil/testsyslog/testsyslog.go:93:3: enforce-switch-style: switch must have a default case clause (revive)
		switch runtime.GOOS {
		case "darwin":
			switch runtime.GOARCH {
			case "arm", "arm64":
				return false
			}
		case "windows":
			return false
		}
Error: pkg/testutil/testsyslog/testsyslog.go:95:4: enforce-switch-style: switch must have a default case clause (revive)
			switch runtime.GOARCH {
			case "arm", "arm64":
				return false
			}
Error: pkg/version/version.go:62:4: enforce-switch-style: switch must have a default case clause (revive)
			switch f.Key {
			case "vcs.revision":
				vcsRevision = f.Value
			case "vcs.modified":
				vcsModified, _ = strconv.ParseBool(f.Value)
			}
227 issues:
* gocritic: 48
* revive: 179

https://github.com/containerd/nerdctl/actions/runs/17294879972/job/49090536229?pr=4490

Details

____________________________________________________________________________________________________
                                          🐯 lint-go-all 🐯
  ____________________________________________________________________________________________________
  make[1]: Entering directory '/home/runner/work/nerdctl/nerdctl/mod/tigron'
  ____________________________________________________________________________________________________
                                        🐯 lint-go: darwin 🐯
  ____________________________________________________________________________________________________
  level=warning msg="The linter 'wsl' is deprecated (since v2.2.0) due to: new major version. Replaced by wsl_v5."
  level=warning msg="[linter] `allow-multiline-assign` is deprecated and always allowed in wsl >= v5"
  level=warning msg="Suggested new configuration:\nlinters:\n  enable:\n    - wsl_v5\n  settings:\n    wsl_v5:\n      allow-first-in-block: true\n      allow-whole-block: false\n      branch-max-lines: 2\n"
  Error: internal/logger/logger.go:62:1: constructor "NewLogger" for struct "ConcreteLogger" should be placed before struct method "Set" (funcorder)
  func NewLogger(logger Logger) *ConcreteLogger {
  ^
  Error: test/command.go:307:1: unexported method "withEnv" for struct "GenericCommand" should be placed after the exported method "T" (funcorder)
  func (gc *GenericCommand) withEnv(env map[string]string) {
  ^
  Error: test/command.go:313:1: unexported method "withTempDir" for struct "GenericCommand" should be placed after the exported method "T" (funcorder)
  func (gc *GenericCommand) withTempDir(path string) {
  ^
  Error: test/command.go:317:1: unexported method "withConfig" for struct "GenericCommand" should be placed after the exported method "T" (funcorder)
  func (gc *GenericCommand) withConfig(config Config) {
  ^
  Error: utils/testca/ca.go:50:1: constructor "NewX509" for struct "Cert" should be placed after the struct declaration (funcorder)
  func NewX509(data test.Data, helpers test.Helpers) *Cert {
  ^
  Error: internal/highk/fileleak.go:52:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command(exe, "-nP", "-p", strconv.Itoa(syscall.Getpid()))
  	                   ^
  Error: internal/com/command.go:241:5: avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
  	if err = cmd.Start(); err != nil {
  	   ^
  Error: internal/com/package_test.go:63:5: avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
  	if err := highk.FindGoRoutines(); err != nil {
  	   ^
  Error: internal/com/pipes.go:68:6: avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
  		if closeErr := pipes.stdin.reader.Close(); closeErr != nil {
  		   ^
  Error: internal/com/pipes.go:74:6: avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
  		if closeErr := pipes.stdout.writer.Close(); closeErr != nil {
  		   ^
  Error: internal/com/pipes.go:80:6: avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
  		if closeErr := pipes.stderr.writer.Close(); closeErr != nil {
  		   ^
  Error: internal/com/pipes.go:91:6: avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
  		if closeErr := pipes.stdin.writer.Close(); closeErr != nil {
  		   ^
  Error: internal/com/pipes.go:97:6: avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
  		if closeErr := pipes.stdout.reader.Close(); closeErr != nil {
  		   ^
  Error: internal/com/pipes.go:103:6: avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
  		if closeErr := pipes.stderr.reader.Close(); closeErr != nil {
  		   ^
  Error: internal/com/pipes.go:147:9: avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
  		if _, err = term.MakeRaw(int(tty.Fd())); err != nil {
  		      ^
  Error: internal/com/pipes.go:208:10: avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
  			if _, copyErr := io.Copy(pipes.stdin.writer, writer()); copyErr != nil {
  			      ^
  Error: internal/com/pipes.go:218:7: avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
  			if closeErr := pipes.stdin.writer.Close(); closeErr != nil {
  			   ^
  Error: require/requirement.go:33:10: avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
  			if _, err := exec.LookPath(name); err != nil {
  			      ^
  Error: test/case.go:243:14: avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
  			if files, err := os.ReadDir(test.Data.Temp().Path()); err == nil {
  			          ^
  Error: test/package_test.go:63:5: avoid inline error handling using `if err := ...; err != nil`; use plain assignment `err := ...` (noinlineerr)
  	if err := highk.FindGoRoutines(); err != nil {
  	   ^
  Error: internal/com/command.go:277:2: enforce-switch-style: switch must have a default case clause (revive)
  	switch {
  	case gc.exec == nil:
  		return nil, ErrExecNotStarted
  	case gc.exec.err != nil:
  		return gc.result, gc.exec.err
  	case gc.result != nil:
  		return gc.result, ErrExecAlreadyFinished
  	}
  Error: internal/com/package_test.go:30:17: redundant-test-main-exit: redundant call to os.Exit in TestMain function, the test runner will handle it automatically as of Go 1.15 (revive)
  	defer func() { os.Exit(exitCode) }()
  	               ^
  Error: test/package_test.go:30:17: redundant-test-main-exit: redundant call to os.Exit in TestMain function, the test runner will handle it automatically as of Go 1.15 (revive)
  	defer func() { os.Exit(exitCode) }()
  	               ^
  Error: utils/utilities.go:17:9: var-naming: avoid meaningless package names (revive)
  package utils
          ^
  24 issues:
  * funcorder: 5
  * noctx: 1
  * noinlineerr: 14
  * revive: 4

https://github.com/containerd/nerdctl/actions/runs/17294879986/job/49090535739?pr=4490

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Some rules are disabled to silence the errors introduced in
this release of golangci-lint.

See PR 4490

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
@ChengyuZhu6
Copy link
Member

Lint failures are annoying

https://github.com/containerd/nerdctl/actions/runs/17294879972/job/49090536229?pr=4490

https://github.com/containerd/nerdctl/actions/runs/17294879986/job/49090535739?pr=4490

I think it may be caused by the new version golangci-lint. The new golangci-lint is detecting these shadowing violations that weren't caught before.

Comment on lines +98 to +103
- name: redundant-test-main-exit
disabled: true
- name: enforce-switch-style
disabled: true
- name: var-naming
disabled: true
Copy link
Member

Choose a reason for hiding this comment

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

Do you think we should refactor test code to enable these checks in the future?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes

Copy link
Member

Choose a reason for hiding this comment

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

I think we can create an issue to track the refactor work.

Copy link
Member

@ChengyuZhu6 ChengyuZhu6 left a comment

Choose a reason for hiding this comment

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

LGTM

@AkihiroSuda AkihiroSuda merged commit 741dd87 into containerd:main Aug 29, 2025
76 of 81 checks passed
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.

2 participants