← Course map

GO LEARNING PATH · 11 LESSONS

Go core

Declarations, zero values, multiple returns and the shapes Go repeats everywhere.

  1. Nothing is uninitialised

    Predict the value of any declared variable before it is assigned.

    3 min · Prediction challenge

  2. := declares, = assigns

    Choose between := and = without guessing, and know when := is illegal.

    3 min · Worked lesson

  3. Read a declaration one scope at a time

    Follow values through a short declaration, an assignment and a shadowed name without running the program.

    3 min · Worked lesson

  4. Read the failure path before the happy path

    Trace a result and error through a complete boundary, including wrapping and partial results.

    3 min · Worked lesson

  5. Two returns instead of one exception

    Write a function that returns a result and an error, and read one.

    3 min · Worked lesson

  6. An unused variable stops the build

    Recognise the two unused errors on sight and know why they exist.

    3 min · Worked lesson

  7. Constants have no type until they need one

    Explain why 1 << 40 compiles as a constant but overflows as an int32.

    3 min · Prediction challenge

  8. switch does not fall through

    Write a Go switch without reaching for break.

    3 min · Worked lesson

  9. Go never converts a number for you

    Fix a mismatched-type expression without guessing.

    3 min · Worked lesson

  10. A return can name what it is handing back

    Write a short function that uses a naked return, and know when not to.

    3 min · Worked lesson

  11. Deferred calls stack, last one first

    Say the print order of three deferred calls.

    3 min · Prediction challenge