lint: enable bodyclose, rowserrcheck and sqlclosecheck linters
What changed, and why it matters
This commit only changes the project's linting configuration file. It enables three Go code-quality linters (bodyclose, rowserrcheck, sqlclosecheck) that detect common resource-leak patterns, and reorganizes comments explaining why other linters remain disabled. It does not change any application code, fix any bug, or alter runtime behavior.
No security action needed. Treat as a normal tooling/CI hygiene change. If desired, monitor subsequent commits that address any new linter findings.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies .golangci.yml. It removes bodyclose, rowserrcheck, and sqlclosecheck from the disabled-linters list, thereby enabling them in CI. It also rewrites the explanatory comments for the still-disabled linters (contextcheck, tparallel, unparam, nilerr, noctx). No source files, tests, or dependencies are touched.
Changed components
.golangci.ymlInspect captured patch +19 / −6
diff --git a/.golangci.yml b/.golangci.yml
index 0133cbe..6ccbf04 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -46,16 +46,29 @@ linters:
# Init functions are used by loggers throughout the codebase.
- gochecknoinits
- # Deprecated linters. See https://golangci-lint.run/usage/linters/.
- - bodyclose
+ # contextcheck requires threading context.Context through many existing
+ # function signatures (including test harnesses), so we leave it off for
+ # now.
- contextcheck
- - nilerr
- - noctx
- - rowserrcheck
- - sqlclosecheck
+
+ # tparallel requires adding t.Parallel() to a large number of existing
+ # subtests, which can surface shared-state races. Disabled until we can
+ # address it carefully.
- tparallel
+
+ # unparam has a sizeable backlog of unused parameters to clean up before it
+ # can be enabled.
- unparam
+ # nilerr is too noisy for our code base: most reports are intentional error
+ # swallowing (documented with comments) or false positives where a boolean
+ # check is mistaken for an error check.
+ - nilerr
+
+ # noctx would only flag a couple of interface methods and a test helper that
+ # have no context to thread through, so it adds little value for now.
+ - noctx
+
# Disable whitespace linters as it has conflict rules against our
# contribution guidelines.
- wsl
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.