Conversation
Add dupword, misspell, nilerr, fatcontext, wastedassign, nosprintfhostport, recvcheck, usetesting, nilnesserr, durationcheck, exptostd, gocheckcompilerdirectives, asciicheck, and reassign linters to .golangci.yaml. Fix all violations: spelling typos and duplicate words in comments and string literals across the codebase. Co-authored-by: Isaac
Use net.JoinHostPort in runlocal config to correctly handle IPv6 addresses. Remove wastedassign linter since it's fully redundant with the already-enabled ineffassign linter. Task: 002.md Co-authored-by: Isaac
The initial commit only ran make lint (changed files). Running the full lint suite revealed 40 pre-existing violations: - nilerr (15): add //nolint with reasons for intentional error swallowing - recvcheck (11): add //nolint for intentional mixed receivers - usetesting (11): use t.TempDir()/t.Setenv() where safe, nolint where the os.* usage is intentional (KeepTmp, custom restore, Windows workaround) - fatcontext (3): add //nolint for false positives (same-parent contexts) Task: 002.md Co-authored-by: Isaac
The nolint directive must be on the line where the issue is reported (the return statement), not on the if statement. Task: 002.md Co-authored-by: Isaac
Approval status: pending
|
Changes
//nolint.fmt.Sprintf→net.JoinHostPort).wastedassignlinter — fully redundant with the already-enabledineffassign.Why
Follow-up to #4978. These linters catch real bugs at compile time (silently discarded errors, IPv6 breakage) and prevent future regressions.
Tests
No new tests. Validated with
golangci-lint run ./.... One existing test assertion updated to match a corrected error string.