Skip to content
Discussion options

You must be logged in to vote

This comes from errcheck v1.30.0, which golangci-lint v2.15.0 bundles: it started reporting a bare receive from a channel whose element type is error (kisielk/errcheck#288), and its accepted "explicit discard" form _ = <-res is exactly what staticcheck's S1005 flags.

It is a known conflict. It was reported in kisielk/errcheck#294, and the staticcheck author said there that S1005 does not look at the channel element type yet and that he plans to fix it in dominikh/go-tools#1844 (still open, so no staticcheck release has it yet). Once that ships and golangci-lint picks it up, _ = <-res will pass both linters.

Until then there are two ways around it without //nolint.

Receive into a variable …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by alexandear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #6885 on October 25, 2026 21:14.