GO LEARNING PATH · 11 LESSONS
Go core
Declarations, zero values, multiple returns and the shapes Go repeats everywhere.
Nothing is uninitialised
Predict the value of any declared variable before it is assigned.
3 min · Prediction challenge
:= declares, = assigns
Choose between := and = without guessing, and know when := is illegal.
3 min · Worked lesson
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
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
Two returns instead of one exception
Write a function that returns a result and an error, and read one.
3 min · Worked lesson
An unused variable stops the build
Recognise the two unused errors on sight and know why they exist.
3 min · Worked lesson
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
switch does not fall through
Write a Go switch without reaching for break.
3 min · Worked lesson
Go never converts a number for you
Fix a mismatched-type expression without guessing.
3 min · Worked lesson
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
Deferred calls stack, last one first
Say the print order of three deferred calls.
3 min · Prediction challenge