Go Course · 49 lessons · approx. 335 minutes

Learn Go

Go is a programming language for servers, command-line tools and other applications. A compiler translates programs into executable files. Here you start with simple outputs and then get to know data and functions. Every new building block is first explained on short pages. The coding exercises compare solution patterns without pretending to be a compiler; you can run free programs in the compiler with a suitable runtime.

  • Hallo, Go!
  • var: remembering a value
  • := and text
  • Calculating and +=
  • bool and comparisons
  • if and else
  • for: repeat on purpose
  • Slices: a flexible list
  • func: reusing a calculation
  • Your Go points coach
  • map: storing values by name
  • range: position and value
  • struct: describing a study session
  • An error as a return value
  • Methods on a struct
  • interface: what a type must be able to do
  • Goroutine and channel: working in parallel
  • defer: cleaning up at the end
  • switch: many cases at a glance
  • Texts and slices
  • Functions in depth
  • Pointers and your own types
  • Maps and structs
  • Interfaces
  • defer, errors and panic

What you’ll learn

  1. Chapter 1From the first character to your own value – Starting point, output, variables and calculating.
    Hallo, Go! · var: remembering a value · := and text · Calculating and +=
  2. Chapter 2Deciding and repeating – Check values and control small sequences.
    bool and comparisons · if and else · for: repeat on purpose
  3. Chapter 3Your own building blocks and a mini project – Organise data, build functions and connect what you have learned.
    Slices: a flexible list · func: reusing a calculation · Your Go points coach
  4. Chapter 4Level up: your next practice chapter – Understand four new building blocks in small steps and use them yourself.
    map: storing values by name · range: position and value · struct: describing a study session · An error as a return value
  5. Chapter 5Master chapter: how real programs are built – Five building blocks from real projects – explained, connected, filled in and written by you.
    Methods on a struct · interface: what a type must be able to do · Goroutine and channel: working in parallel · defer: cleaning up at the end · switch: many cases at a glance
  6. Chapter 6Texts and slices – Work with strings and strconv, slice and sort slices, and count words.
    The strings package · Numbers and texts: strconv · Slicing slices · Sorting with sort · Boss: count words
  7. Chapter 7Functions in depth – Multiple return values, variadic functions, closures and your own errors.
    Multiple return values · Any number of arguments: ...int · Closures: functions with a memory · Your own errors: errors and fmt.Errorf · Boss: checking inputs
  8. Chapter 8Pointers and your own types – Pointers, embedding, your own String methods, iota and a small warehouse.
    Pointers: & and * · Embedding instead of inheritance · Your own output with String() · Constants with iota · Boss: a small stock
  9. Chapter 9Maps and structs – Look up values in maps, detect missing keys, collect structs in slices and sort them.
    Looking up with map · Does the key exist? The comma-ok · Structs in a slice · Sorting by a field: sort.Slice · Boss: a grade book
  10. Chapter 10Interfaces – Describe behaviour without writing “implements”: interfaces, polymorphism, type switch and type assertions.
    Describing behaviour: interface · Many types, one loop · Which type is inside? type switch · Looking specifically: type assertion · Boss: different payment methods
  11. Chapter 11defer, errors and panic – Clean up with defer, wrap and detect errors, own error types, panic and recover.
    Cleaning up at the end: defer · Wrapping and recognising errors: %w and errors.Is · Error types of your own · Emergency brake: panic and recover · Boss: an account with clean errors

Final project: Go points coach

Combine variables, a decision and an output into your own points coach.

How it works

Every lesson starts with short explanation pages. Then you practise with multiple-choice questions, fill-in-the-gap tasks, putting code in order and writing your own code – with hints and instant feedback. Free, without ads, on phone, tablet and PC.

Learn Go now