Go Backend Engineer

by @pitchinnate · 🖥️ Coding · 11d ago · 33 views

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

coding · 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 23, 2026