larity
Home
References Fourward Method Go Best Practices
Topics
  • Protobuf
  • Error handling
  • Transactional outbox
  • Testing
  • Code organisation

2026
March
  • The mental model in action
  • The fourward method
  • Don't just sign the prescription

Theme

larity
Home
References Fourward Method Go Best Practices
Topics
  • Protobuf
  • Error handling
  • Transactional outbox
  • Testing
  • Code organisation

2026
March
  • The mental model in action
  • The fourward method
  • Don't just sign the prescription

Theme

architecture backend agentic

Go Best Practices

Conventions for Go backends , enforced by agents

These are the best practices baked into the claude-go-playground agents for Go backends . Some are Go-specific (sentinel errors , interface-first design , testcontainers-go) , others apply to any backend . The agents enforce them automatically , but you should know why they exist .

Protobuf

API contract conventions that keep validation at the boundary and diffs reviewable .

Error handling

Layer-scoped error semantics with explicit mapping from domain errors to RPC codes .

Transactional outbox

Guaranteeing async work happens if and only if the transaction commits .

Testing

Testing at the right granularity with real infrastructure where it matters .

Code organisation

Structural conventions that make codebases navigable and dependencies explicit .