golangci-lint run ./... (v2.15.0, default linters, no .golangci.yml) reports 71 issues on fix/v0.15-review (92e19fcb). go vet, staticcheck ./... (standalone) and make check pass; golangci-lint is not part of make check or CI.
None of these were linked to a concrete bug during the v0.15.0 release review. They need a triage pass, not a blind fix.
errcheck (50)
Almost all are unchecked Close calls on cleanup paths.
Production code (20):
| File | Calls |
|---|---|
internal/adapters/drm/frame_submit.go |
7 × pdone/xdone/done.Close |
internal/adapters/fdwait/poller.go |
3 × p.file/p.wake.Close |
internal/adapters/outputkit/routing/leases.go |
3 × (*os.File).Close |
internal/adapters/logging/logging.go |
2 × lifecycle.Close, f.Close (session lock files) |
internal/adapters/drm/card.go, cursor_images.go, frame_lifecycle.go, supervisor/supervisor.go |
1 each (Close) |
examples/testime/main.go |
1 × c.Close |
Tests (30): mostly fdwait, drm, routing, logging, powerkey, core tests.
staticcheck (21)
| Check | Count | Meaning |
|---|---|---|
| QF1008 | 9 | Embedded field selector can be omitted |
| QF1003 | 5 | Use a tagged switch instead of an if/else chain |
| QF1001 | 3 | Apply De Morgan's law |
| QF1002 | 2 | Use a tagged switch on a value |
| ST1023 | 2 | Omit the redundant type in a declaration |
Spread over internal/core (x11active, workspace_operations, spawn_placement, separators, sdr_expansion, some tests), internal/adapters/wayland (clipboard, colormanagement, activation, xwm/mapflow), drm/supervisor and outputkit/routing.
Proposed approach
- errcheck, production: decide per call. A
Closeon a read-only fd or a cleanup after another error is fine to ignore: make it explicit with_ =(or a shared helper). AClosethat can lose data or hides a sync/fence failure (frame_submit.go,leases.go) should be checked or at least logged with acomponentfield. - errcheck, tests: check the error, or ignore it explicitly.
- staticcheck QF/ST: apply where it makes the code clearer. These are quick fixes, not bugs.
- Add a
.golangci.ymlwith the agreed linters, and alinttarget inmake checkplus CI, so new warnings do not pile up again.
Reproduce
golangci-lint run ./...