Add static analysis to CI and harden build#25
Merged
Conversation
19bc795 to
cf86b0e
Compare
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>
cf86b0e to
72d2598
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
lintjob to CI and tightens the build:checkout@v3→v4,setup-go@v4→v5. The lint job derives its Go version fromgo.modviago-version-file, so it can't drift.go.mod/go.sumand runsgo mod downloadbefore copying source, caching dependencies across source-only changes.Code change
sendResponsepreviously discarded thejson.Marshalerror (_) and ignoredw.Write's error. It now returns500on a marshal failure and logs a write failure instead of silently dropping them.Testing
gofmt -l .→ cleango vet ./...→ cleanmake test(race) andmake buildpassdocker build .succeeds with the new layer caching🤖 Generated with Claude Code