8000
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
S1005 flags _ = <-errCh, which errcheck v1.30.0 requires for a discarded error receive #1844
Since errcheck v1.30.0 (2026-10-09, kisielk/errcheck#288), a bare receive from a channel whose element type implements error is reported as an unchecked error, so errcheck ./... on the same file reports main.go:10:2: <-errCh. errcheck accepts _ = <-errCh as the explicit discard, the same way it accepts _ = f(). S1005 then rewrites _ = <-errCh back into <-errCh (it is the example in the check's documentation, and s1005.go matches (Ident "_") _ recv@(UnaryExpr "<-" _)), so a project that runs both linters, as golangci-lint does by default, has no spelling of "receive and discard this error" that passes.
The code is fine: the blank assignment documents that the received value is an error dropped on purpose, which is what errcheck asks for. Could S1005 leave _ = <-ch alone when the channel's element type implements error? The rewrite would stay for channels of other types, where the blank identifier carries no information.
Activity
chore(deps): update golangci-lint to v2.15.0 and fix errcheck findings
Bump golangci-lint to 2.15.0