GO LEARNING PATH · 4 LESSONS
Clean code: production contracts
Composition roots, context ownership, package APIs and exact time/money contracts.
A composition root makes lifetime and cleanup visible
Construct dependencies once and make their ownership and shutdown order explicit.
3 min · Worked lesson
Context is a cancellation contract, not a bag of dependencies
Propagate request cancellation while giving detached work an explicit owner and deadline.
3 min · Worked lesson
Package APIs should reveal their change boundary
Use narrow consumer contracts and tests that make accidental coupling visible.
3 min · Worked lesson
Time and money need units and presence in their types
Separate durations, instants and exact amounts instead of passing ambiguous numbers.
3 min · Worked lesson