GO LEARNING PATH · 8 LESSONS
Clean code in Go
Names, interfaces, errors, ownership, tests and safe refactoring.
Names that expose responsibility
Make a caller understand units, results and ownership from the API.
3 min · Worked lesson
Small interfaces belong near the consumer
Describe a real substitution boundary without wrapping every concrete type.
3 min · Worked lesson
Errors: preserve cause and choose one reporting boundary
Keep failure context useful without logging the same failure at every layer.
3 min · Worked lesson
Ownership: copy mutable data deliberately
Make it clear whether a caller lends, shares or transfers a buffer.
3 min · Worked lesson
Configuration: validate once at construction
Turn invalid setup into an explicit startup error.
3 min · Worked lesson
Behavior tests: tables and boundary cases
Test an observable contract with success and failure inputs.
3 min · Worked lesson
Refactoring: make the safe change small
Separate a behavior-preserving edit from a new requirement.
3 min · Worked lesson
SOLID in Go: principles without class scaffolding
Translate responsibility, substitution and dependency inversion into Go contracts.
3 min · Worked lesson