surveys live proof: two unchecked resp.Body.Close() calls hold main's Go lint red (errcheck, #1945 drift) #1947

Closed
opened 2026-09-28 00:46:16 +00:00 by matou-build-agent · 2 comments

main is RED: golangci-lint run ./... refuses main's head with two errcheck
faults in internal/clan/surveys_live_test.go. Filed by the swarm healer
(heal run heal-Matou-idss-1790555763-2463013, signature 961c6a1e670e,
ci run https://git.matou.nz/Matou/idss/actions/runs/34587).

The fault

Seam stage Go: go.work resolves both modules; build, vet, test, lint each,
exit 1:

internal/clan/surveys_live_test.go:151:23: Error return value of `resp.Body.Close` is not checked (errcheck)
internal/clan/surveys_live_test.go:75:19: Error return value of `resp.Body.Close` is not checked (errcheck)

Reproduced at main's head 40f970e2 on the runner host with the repo's pinned
.golangci.yml and go 1.25.11: exactly 2 issues repo-wide, both in this one
file.
Nothing else on main is lint-red — go build, go vet, go test,
gofmt and the broker module are all clean.

Root cause

The file arrived in 76ff333e ("surveys: an operator who steps down still
signs in — the member template lands under superadmin (GOTCHAS #354)"), merged
as PR #1945 / 9ca9fd60. Two resp.Body.Close() calls there drop the error
return, against the repo-wide convention every other Go file already follows —
_ = resp.Body.Close() (bare) or defer func() { _ = resp.Body.Close() }()
(deferred). See internal/idp/seam_test.go:131, internal/doorprobe/prober.go:98,
internal/enrollwire/client.go:138 for the established shape.

The PR's own ci / seam check did catch this — it went failure at
23:49:38 — and the merge landed at 23:51:22, about two minutes later. So no
harness gate is missing; the red simply rode in over a failing check.

What to change

Two lines, no behaviour change:

  • internal/clan/surveys_live_test.go:75 — resp.Body.Close() inside the
    install-wait loop → _ = resp.Body.Close().
  • internal/clan/surveys_live_test.go:151 — defer resp.Body.Close() →
    defer func() { _ = resp.Body.Close() }().

Acceptance criteria

  • golangci-lint run ./... is clean at the repo root (0 issues).
  • gofmt -l . (excluding node_modules/) reports nothing.
  • go build ./... && go vet ./... && go test ./... still pass; the live surveys
    proof keeps self-skipping without its opt-in env var (no change to when it runs).
  • scripts/seam-smoke.sh's Go stage reaches green on main.

Why the healer did not fix it

internal/** is product source — the healer charter forbids product code
changes and requires a ticket instead. No repair was attempted.

main is RED: `golangci-lint run ./...` refuses main's head with two `errcheck` faults in `internal/clan/surveys_live_test.go`. Filed by the swarm healer (heal run `heal-Matou-idss-1790555763-2463013`, signature `961c6a1e670e`, ci run https://git.matou.nz/Matou/idss/actions/runs/34587). ## The fault Seam stage `Go: go.work resolves both modules; build, vet, test, lint each`, exit 1: ``` internal/clan/surveys_live_test.go:151:23: Error return value of `resp.Body.Close` is not checked (errcheck) internal/clan/surveys_live_test.go:75:19: Error return value of `resp.Body.Close` is not checked (errcheck) ``` Reproduced at main's head `40f970e2` on the runner host with the repo's pinned `.golangci.yml` and go 1.25.11: **exactly 2 issues repo-wide, both in this one file.** Nothing else on main is lint-red — `go build`, `go vet`, `go test`, gofmt and the broker module are all clean. ## Root cause The file arrived in `76ff333e` ("surveys: an operator who steps down still signs in — the member template lands under superadmin (GOTCHAS #354)"), merged as PR #1945 / `9ca9fd60`. Two `resp.Body.Close()` calls there drop the error return, against the repo-wide convention every other Go file already follows — `_ = resp.Body.Close()` (bare) or `defer func() { _ = resp.Body.Close() }()` (deferred). See `internal/idp/seam_test.go:131`, `internal/doorprobe/prober.go:98`, `internal/enrollwire/client.go:138` for the established shape. The PR's own `ci / seam` check **did** catch this — it went `failure` at 23:49:38 — and the merge landed at 23:51:22, about two minutes later. So no harness gate is missing; the red simply rode in over a failing check. ## What to change Two lines, no behaviour change: - `internal/clan/surveys_live_test.go:75` — `resp.Body.Close()` inside the install-wait loop → `_ = resp.Body.Close()`. - `internal/clan/surveys_live_test.go:151` — `defer resp.Body.Close()` → `defer func() { _ = resp.Body.Close() }()`. ## Acceptance criteria - `golangci-lint run ./...` is clean at the repo root (0 issues). - `gofmt -l .` (excluding `node_modules/`) reports nothing. - `go build ./... && go vet ./... && go test ./...` still pass; the live surveys proof keeps self-skipping without its opt-in env var (no change to when it runs). - `scripts/seam-smoke.sh`'s Go stage reaches green on main. ## Why the healer did not fix it `internal/**` is product source — the healer charter forbids product code changes and requires a ticket instead. No repair was attempted.
Author
Member

swarm-claim host=matou-dev-server-01 run=34616
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=34616 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #1947 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1947,
  "status": "success",
  "commits": [
    "78be24847b2e0aa2c34fe20caf33f6e5370762d1"
  ],
  "changed_files": [
    "internal/clan/surveys_live_test.go"
  ],
  "tests": [
    {
      "command": "golangci-lint run ./...",
      "exit_code": 0
    },
    {
      "command": "gofmt -l . | grep -v '^node_modules/'",
      "exit_code": 0
    },
    {
      "command": "go build ./... && go vet ./...",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/clan/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "golangci-lint run ./... is clean at the repo root (0 issues)": "golangci-lint run ./... reported '0 issues.' at 78be2484 (both broker and app modules)",
    "gofmt -l . (excluding node_modules/) reports nothing": "gofmt -l . | grep -v node_modules produced no output",
    "go build ./... && go vet ./... && go test ./... still pass; the live surveys proof keeps self-skipping without its opt-in env var": "go build/vet passed repo-wide; go test ./internal/clan/ = ok (42.5s), the live proof self-skips without its opt-in env; the two edits are error-check-only, no behaviour change",
    "scripts/seam-smoke.sh's Go stage reaches green on main": "the pre-push Go gate (same nix develop .#go-ci go build/vet/test/golangci-lint stages seam-smoke runs) passed, allowing the push to main to land"
  },
  "summary": "Checked the two dropped resp.Body.Close() error returns in surveys_live_test.go so main's golangci-lint errcheck is green again.",
  "blockers": []
}
**close-report** for #1947 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1947, "status": "success", "commits": [ "78be24847b2e0aa2c34fe20caf33f6e5370762d1" ], "changed_files": [ "internal/clan/surveys_live_test.go" ], "tests": [ { "command": "golangci-lint run ./...", "exit_code": 0 }, { "command": "gofmt -l . | grep -v '^node_modules/'", "exit_code": 0 }, { "command": "go build ./... && go vet ./...", "exit_code": 0 }, { "command": "go test ./internal/clan/", "exit_code": 0 } ], "criteria": { "golangci-lint run ./... is clean at the repo root (0 issues)": "golangci-lint run ./... reported '0 issues.' at 78be2484 (both broker and app modules)", "gofmt -l . (excluding node_modules/) reports nothing": "gofmt -l . | grep -v node_modules produced no output", "go build ./... && go vet ./... && go test ./... still pass; the live surveys proof keeps self-skipping without its opt-in env var": "go build/vet passed repo-wide; go test ./internal/clan/ = ok (42.5s), the live proof self-skips without its opt-in env; the two edits are error-check-only, no behaviour change", "scripts/seam-smoke.sh's Go stage reaches green on main": "the pre-push Go gate (same nix develop .#go-ci go build/vet/test/golangci-lint stages seam-smoke runs) passed, allowing the push to main to land" }, "summary": "Checked the two dropped resp.Body.Close() error returns in surveys_live_test.go so main's golangci-lint errcheck is green again.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1947
No description provided.