Skip to content
Nexonauts
All languages

Go by example

Each topic is one program, broken into steps. Explanation on the left, code on the right.

  1. 1

    Goroutines

    Lightweight concurrent functions managed by the Go runtime.

  2. 2

    Channels

    Typed pipes for sending values between goroutines.

  3. 3

    Select

    Wait on multiple channel operations at once.

  4. 4

    WaitGroups

    Wait for a known number of goroutines to finish.

  5. 5

    Mutex

    Protect shared state when channels don't fit.

  6. 6

    Context

    Cancellation, deadlines, and request-scoped values.