← Course map

GO LEARNING PATH · 8 LESSONS

Clean code in Go

Names, interfaces, errors, ownership, tests and safe refactoring.

  1. Names that expose responsibility

    Make a caller understand units, results and ownership from the API.

    3 min · Worked lesson

  2. Small interfaces belong near the consumer

    Describe a real substitution boundary without wrapping every concrete type.

    3 min · Worked lesson

  3. Errors: preserve cause and choose one reporting boundary

    Keep failure context useful without logging the same failure at every layer.

    3 min · Worked lesson

  4. Ownership: copy mutable data deliberately

    Make it clear whether a caller lends, shares or transfers a buffer.

    3 min · Worked lesson

  5. Configuration: validate once at construction

    Turn invalid setup into an explicit startup error.

    3 min · Worked lesson

  6. Behavior tests: tables and boundary cases

    Test an observable contract with success and failure inputs.

    3 min · Worked lesson

  7. Refactoring: make the safe change small

    Separate a behavior-preserving edit from a new requirement.

    3 min · Worked lesson

  8. SOLID in Go: principles without class scaffolding

    Translate responsibility, substitution and dependency inversion into Go contracts.

    3 min · Worked lesson