Repository navigation
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 achan errorwhose 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: theCloneRangeerror 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.