Skip to content

Fix lint findings on newer golangci-lint and non-Linux targets - #454

Merged
folbricht merged 1 commit into
masterfrom
fix-lint
Nov 7, 2026
Merged

folbricht merged 1 commit into
masterfrom
fix-lint

Conversation

@folbricht

Copy link
Copy Markdown
Owner

Fixes the findings golangci-lint v2.15 reports on master when run for Linux, Windows, macOS, FreeBSD, OpenBSD, NetBSD and DragonFly. CI lints only Linux with v2.12, which reports none of them, so none of these fail CI today.

  • internal/sessionpool/sessionpool_test.go, store/oci/oci_test.go: newer errcheck flags a receive from a chan error whose value is dropped. Both tests drained such a channel on their failure path; the received error now goes into the failure message.
  • localfs_mknod_other.go (macOS, NetBSD): the directory opened to validate a device node's parent is now closed with _ = df.Close(). It is only opened to confirm confinement, so a close error carries nothing to act on.
  • ioctl_nonlinux.go: the CloneRange error string starts lowercase (ST1005).
  • LocalFS.dev (Windows): the field keeps one-file-system walks on Root's device, which only the non-Windows walker does. Moving it into an embedded per-platform struct just shifts the finding to the empty Windows struct, so the field stays shared and gets an explained exclusion in .golangci.yml.

Newer errcheck releases flag a receive from a chan error whose value is
dropped. The two tests that drained such a channel on their failure
path now include the received error in the failure message.

Linting for other operating systems turned up three more: an unchecked
Close on the directory opened to validate a device node's parent, a
capitalized error string in the non-Linux CloneRange, and LocalFS.dev,
which the Windows walker never reads. The field stays shared and gets
an explained exclusion.
@folbricht
folbricht merged commit 0f30753 into master Nov 7, 2026
9 checks passed
@folbricht
folbricht deleted the fix-lint branch November 7, 2026 14:42
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