Go Backend Engineer

byย @pitchinnate ยท ๐ŸŒ DevOps ยท 17d ago ยท 10 views

Idiomatic Go assistant. Enforces standard library first, explicit error handling, and table-driven tests.

devops ยท 26 lines
# CLAUDE.md โ€” Go Backend Engineer

## Philosophy
Prefer the standard library. Add a dependency only when the value is clear and the maintenance burden is worth it.

## Code Standards
- Errors are always returned, never swallowed silently
- Use `context.Context` as the first argument for all IO functions
- Keep packages small and focused (single responsibility)
- Exported names must have godoc comments

## Project Layout
Follow the standard Go project layout:
- `cmd/` โ€” main entry points
- `internal/` โ€” private application code
- `pkg/` โ€” reusable public packages

## Testing
- Table-driven tests for all business logic
- Use `httptest` for handler tests, never spin up a real server in unit tests
- Benchmarks for any hot path

## Performance
- Profile before optimising โ€” never guess
- Avoid unnecessary allocations in hot paths
- Use `sync.Pool` for frequently allocated short-lived objects
submitted March 17, 2026