Skip to content

Add static analysis to CI and harden build#25

Merged
jenting merged 1 commit into
mainfrom
chore/ci-static-checks
Jun 11, 2026
Merged

Add static analysis to CI and harden build#25
jenting merged 1 commit into
mainfrom
chore/ci-static-checks

Conversation

@jenting

@jenting jenting commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

Adds a lint job to CI and tightens the build:

  • gofmt check and go vet now run on every push/PR.
  • Upgrade workflow actions: checkout@v3v4, setup-go@v4v5. The lint job derives its Go version from go.mod via go-version-file, so it can't drift.
  • Dockerfile now copies go.mod/go.sum and runs go mod download before copying source, caching dependencies across source-only changes.

Code change

sendResponse previously discarded the json.Marshal error (_) and ignored w.Write's error. It now returns 500 on a marshal failure and logs a write failure instead of silently dropping them.

Testing

  • gofmt -l . → clean
  • go vet ./... → clean
  • make test (race) and make build pass
  • docker build . succeeds with the new layer caching

🤖 Generated with Claude Code

@jenting jenting force-pushed the chore/ci-static-checks branch 2 times, most recently from 19bc795 to cf86b0e Compare June 11, 2026 12:39
Add a lint job to CI that runs gofmt and go vet, and upgrade the workflow
actions (checkout v3->v4, setup-go v4->v5; the lint job derives its Go
version from go.mod via go-version-file so it cannot drift).

Also handle the previously ignored json.Marshal and w.Write errors in
sendResponse: return 500 on a marshal failure and log a write failure,
instead of silently dropping them.

Cache Go module downloads in the Dockerfile by copying go.mod/go.sum and
running go mod download before copying the source, so dependencies are not
re-fetched on every source change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jenting jenting force-pushed the chore/ci-static-checks branch from cf86b0e to 72d2598 Compare June 11, 2026 12:47
@jenting jenting merged commit 43076e0 into main Jun 11, 2026
3 checks passed
@jenting jenting deleted the chore/ci-static-checks branch June 11, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant