Problem
There is no CI pipeline enforcing code quality on push or PR. This means formatting drift, test failures, and lint regressions can land silently.
Also, the "context" import in internal/app/update.go is in its own group between stdlib and third-party — goimports would normalize this. Running goimports -w ./... (not just gofmt) enforces the correct stdlib / external / internal grouping automatically.
Proposed Change
Add .github/workflows/ci.yml:
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Verify formatting (goimports)
run: |
go install golang.org/x/tools/cmd/goimports@latest
diff <(goimports -l .) /dev/null
- name: Run tests
run: go test ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
Also fix the "context" import grouping in internal/app/update.go as part of this PR by running goimports -w ./....
Why
go test ./... catches regressions before merge
goimports enforces consistent import grouping (stdlib / external / internal) automatically
golangci-lint catches unused variables, shadowed errors, missing error checks (errcheck), and style issues that gofmt misses
- Takes ~15 minutes to set up and prevents an entire class of regressions permanently
Files
.github/workflows/ci.yml (new), internal/app/update.go (import fix)
Problem
There is no CI pipeline enforcing code quality on push or PR. This means formatting drift, test failures, and lint regressions can land silently.
Also, the
"context"import ininternal/app/update.gois in its own group between stdlib and third-party —goimportswould normalize this. Runninggoimports -w ./...(not justgofmt) enforces the correct stdlib / external / internal grouping automatically.Proposed Change
Add
.github/workflows/ci.yml:Also fix the
"context"import grouping ininternal/app/update.goas part of this PR by runninggoimports -w ./....Why
go test ./...catches regressions before mergegoimportsenforces consistent import grouping (stdlib / external / internal) automaticallygolangci-lintcatches unused variables, shadowed errors, missing error checks (errcheck), and style issues thatgofmtmissesFiles
.github/workflows/ci.yml(new),internal/app/update.go(import fix)