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
|`channelcheck`| Flag channel usage patterns that can deadlock or block. | • Blocking channel sends outside a `select`<br>• Unbuffered channel creation (`make(chan T)`)<br>• Ignore specific channels |
13
+
|`channelcheck`| Flag channel usage patterns that can deadlock or block. | • Blocking channel sends outside a `select`<br>• Unbuffered channel creation (`make(chan T)`)<br>• Empty `default:` that silently drops a send (advisory, off by default)<br>• Ignore specific channels |
| `bufferMax` | `uint` | `0` | Flag channel buffers larger than this. `0` disables the check. |
72
+
| `emptyDefault` | `bool` | `false` | Advisory: flag an empty `default:` in a `select` with a send, since it silently drops the send. Off by default — it fires on the idiomatic non-blocking/coalescing-send pattern, so enable it only where dropping should always be logged or documented. |
73
+
| `ignoreChannelsByName` | `[]string` | `[]` | Channel/field names whose direct sends are exempt from the blocking-send, empty-default, and `ctx.Done()` checks. |
74
+
64
75
## Development
65
76
66
77
### Adding a new linter
@@ -94,6 +105,8 @@ linters:
94
105
path: ./rules/<linter>
95
106
```
96
107
6. `make test && make build && make build-golangci-lint` to verify.
108
+
7. Add linter to `.golangci.yml`.
109
+
8. Fix linter errors in the monorepo with legitimate changes or a `nolint` comment.
0 commit comments