| name | go-debug-flow |
| description | Minimal Go build, test, debug, and lint workflow for pacman. |
Go Debug Flow
Start narrow. Run package-level tests before broader targets.
- Identify the package from changed files.
- Run targeted tests:
go test -count=1 ./internal/controlplane
go test -count=1 ./internal/agent
go test -count=1 ./tools/jepsenctl/cmd
- For a specific test, use
-run '^TestName$' -v.
- For flakes or race-prone logic, rerun the smallest package/test with
-count=20 before widening scope.
- Use
go test ./... only after targeted tests pass or when shared contracts
changed.
- Build binaries with repo Make targets when packaging/link flags matter;
otherwise
go test usually compiles enough.
- Run
make lint or golangci-lint run when touching style-sensitive or
shared packages.
Debugging hints:
- Preserve context cancellation and deadlines in tests.
- Prefer table-driven cases for state-machine and API validation.
- Use existing test helpers in the package before adding new fixtures.
- Check generated/OpenAPI/package artifacts only when the touched subsystem owns
them.