Template ships a non-green baseline: missing go.sum + two errcheck lint bugs #2

Open
opened 2026-07-04 10:42:30 +00:00 by mathias · 0 comments
Owner

Problem

A repo generated from template-go-agent does not pass task check out of the box, even after correct placeholder substitution. Two template-level defects break the baseline:

  1. No go.sum shipped. The template root has go.mod but no go.sum, so go build ./... fails on missing sum entries until someone runs go mod tidy. Verified: the template root currently ships no go.sum file.
  2. Two errcheck lint failures in the template's own code — an unchecked deferred shutdown(ctx) and an unchecked resp.Body.Close(). golangci-lint (v2.x, as configured in CI) fails on both.

Evidence

Surfaced while bootstrapping mathias/parallax (generated from this template). koala Claude had to fix all three items by hand to get a green baseline — see parallax#1 and commit 5dce341 in that repo. Because these are defects in the template source, every repo generated from template-go-agent inherits them.

Desired outcome

A freshly generated repo passes task check immediately after substitution, with no manual fix-ups.

Suggested fixes (technique TBD in this repo)

  • Commit a go.sum (run go mod tidy and check it in), or add a CI/generation step that guarantees it.
  • Fix the two errcheck sites: check the errors on the deferred shutdown(ctx) and resp.Body.Close() (e.g. _ = f() if intentionally ignored, or proper handling/logging).
  • Confirm go build ./... and task check are green on a clean checkout before closing.

Notes

  • This template is not dispatch-eligible yet, so this is a manual/local task (run on koala), not a dispatch job.
  • Independent of the gitea-mcp substitution/durability issues (filed separately) — this is purely a template-content fix and can land on its own.
## Problem A repo generated from `template-go-agent` does **not** pass `task check` out of the box, even after correct placeholder substitution. Two template-level defects break the baseline: 1. **No `go.sum` shipped.** The template root has `go.mod` but no `go.sum`, so `go build ./...` fails on missing sum entries until someone runs `go mod tidy`. Verified: the template root currently ships no `go.sum` file. 2. **Two `errcheck` lint failures in the template's own code** — an unchecked deferred `shutdown(ctx)` and an unchecked `resp.Body.Close()`. `golangci-lint` (v2.x, as configured in CI) fails on both. ## Evidence Surfaced while bootstrapping `mathias/parallax` (generated from this template). koala Claude had to fix all three items by hand to get a green baseline — see parallax#1 and commit `5dce341` in that repo. Because these are defects in the template *source*, every repo generated from `template-go-agent` inherits them. ## Desired outcome A freshly generated repo passes `task check` immediately after substitution, with no manual fix-ups. ## Suggested fixes (technique TBD in this repo) - Commit a `go.sum` (run `go mod tidy` and check it in), or add a CI/generation step that guarantees it. - Fix the two `errcheck` sites: check the errors on the deferred `shutdown(ctx)` and `resp.Body.Close()` (e.g. `_ = f()` if intentionally ignored, or proper handling/logging). - Confirm `go build ./...` and `task check` are green on a clean checkout before closing. ## Notes - This template is **not dispatch-eligible yet**, so this is a manual/local task (run on koala), not a dispatch job. - Independent of the gitea-mcp substitution/durability issues (filed separately) — this is purely a template-content fix and can land on its own.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mathias/template-go-agent#2