Go: From Basics to Expert
Four levels, twelve lessons, every example vetted and run on a real toolchain
Go was built at Google for one problem: large teams writing network services that have to be maintained for years. Everything distinctive about it follows from that - the small feature set, the strict formatting, the fast compiler, the single static binary with no runtime to install.
Overview
What you get for it is the easiest deployment story in mainstream programming and the most approachable concurrency model: goroutines and channels make concurrent code something you write on purpose rather than something you survive. It is why so much of the infrastructure you use - Docker, Kubernetes, Terraform - is written in it.
Introduction
No Go is assumed. The language is small enough that this course can be genuinely complete, and that is the shape it takes: by the end you will have seen essentially all of Go rather than a working subset. If you come from a language with inheritance or exceptions, the adjustment is in Level 2, and it is a short one.
Each level is three lessons and a Level Check quiz, then an Expert Exam. There is no in-browser Go runner on the site yet, so every example was run through go vet and executed on a real toolchain before publication - install Go from go.dev and run each one with go run main.go, or paste it into the Go playground.
Every example in this course was run through go vet and executed on a real Go toolchain before publication. There is no in-browser Go runner yet, so the code blocks are for reading and for running in your own editor.
There is no in-browser runner for this language on the site, so to follow along install it from go.dev and run each one with go run main.go, or paste it into the Go playground.
By the end you will be able to write Go the way the standard library is written: interfaces declared where they are consumed, errors wrapped and inspected rather than swallowed, goroutines that are guaranteed to finish, context threaded through properly, and a module laid out so a change stays small.
What you will be able to do
- Rely on the zero value, and know why a nil map cannot be written
- Explain what append does to a shared backing array
- Choose a pointer or a value receiver for a reason you can state
- Wrap errors so the final message reads like a path to the cause
- Say who closes a channel, and how a goroutine is told to stop
- Arrange a module so the interface belongs to the code that uses it
What each level covers
4 levels · 16 lessons
-
Level 1 - Basic
Go's starting assumptions, which are different from most languages. The zero value is always usable, so a declared variable is already safe; there are no implicit conversions; there is one loop keyword; and defer runs at the end of the function rather than the block. The level closes on slices and maps, and the aliasing that surprises everyone exactly once.
4 lessons 43 min of reading
Start with Values, Types and the Zero Value → -
Level 2 - Intermediate
How Go does the things other languages use classes for. Structs and methods, with the pointer or value receiver decision you will make constantly; interfaces satisfied implicitly and declared by the code that consumes them, plus type switches and generics; and errors as ordinary values, with wrapping, errors.Is and errors.As.
4 lessons 49 min of reading
Start with Structs, Methods and Composition → -
Level 3 - Advanced
Concurrency, which is the reason most people come to Go. Goroutines and channels, including the four deadlocks you will actually hit and how each one looks; context, pipelines and worker pools, which is how cancellation and limits are really done; and a tour of the parts of the standard library that turn up in nearly every program.
4 lessons 52 min of reading
Start with Goroutines and Channels → -
Level 4 - Expert
What the compiler and the runtime decide for you. Escape analysis and why a value lands on the heap, with the goroutine leaks a collector cannot prevent; where the time goes, found with pprof rather than intuition; and how to arrange a module, including the internal directory and what a package boundary is for.
4 lessons 58 min of reading
Start with Memory, Escape Analysis and the Collector →
Guides and articles
Longer reading about this subject, written alongside the course.
Before you start
- No prior Go
- Some experience of any programming language helps but is not required
Common questions
- What does the Go: From Basics to Expert course cover?
- It is 4 levels and 16 lessons: Level 1 - Basic; Level 2 - Intermediate; Level 3 - Advanced; Level 4 - Expert. Each level ends with a quiz, and the last one is an exam over the whole course.
- How long does it take?
- About 202 minutes of reading and exercises - roughly 3.4 hours. It is self-paced with no cohort and no start date, so you can leave and come back and the site remembers where you were.
- What do I need to know first?
- No prior Go. Some experience of any programming language helps but is not required.
- Is it free?
- Yes. Every lesson, example and quiz in this course is free to read, and you do not need an account to read them. Signing in only adds progress tracking and quiz results.
- What will I be able to do afterwards?
- Rely on the zero value, and know why a nil map cannot be written. Explain what append does to a shared backing array. Choose a pointer or a value receiver for a reason you can state. Wrap errors so the final message reads like a path to the cause. Say who closes a channel, and how a goroutine is told to stop. Arrange a module so the interface belongs to the code that uses it.