From setting up your environment through variables, control flow, slices and maps, functions and pointers, structs and interfaces, error handling, splitting packages, generics, concurrency and testing. Fifty lessons that take you to the point where you can assemble a tested tool using nothing but the standard library. Every piece of code and result shown was produced by actually running Go 1.27.1.
about 3 hours in total (estimate)
The 50 lessons are grouped into seven chapters. Working through them in order is the best way,
but you are welcome to dip into whatever interests you.
Note: this cannot run inside the browser, so try it with your own go run or the Go Playground (go.dev/play).
Take this chapter's review quiz ›
You get to grips with how Go runs and get to the point of executing it yourself with go run. You cover variables, zero values, numbers and strings and standard input, and how to read compiler errors.
Take this chapter's review quiz ›
You cover conditionals and repetition: if without parentheses, switch that does not fall through, for as the only loop, and breaking out with labels. You finish by assembling a number-guessing game.
Take this chapter's review quiz ›
You gather data with arrays, slices, maps and multiple dimensions. The crux of Go — that a slice shares its underlying array — is taken on head-on here, and you finish by aggregating sales data.
Take this chapter's review quiz ›
You give a piece of work a name and pull it out. Multiple return values and (result, error), variadic parameters, closures, defer, and on to pointers and recursion.
Take this chapter's review quiz ›
You create your own data types. Structs and methods, embedding rather than inheritance, and interfaces with no implements keyword. You go as far as plugging your own types into the standard library's machinery.
Take this chapter's review quiz ›
You learn systematically how failure is handled in a language with no exceptions. Wrapping with %w, panic and recover, files and JSON. You finish by designing an inventory system with structs.
Take this chapter's review quiz ›
You cover splitting packages, generics, concurrency and testing. Finally you pull all 50 lessons together and see what to learn next.
Once you have finished all 50 lessons, look at Rust for Beginners, another compiled language that leans toward safety, or learn to ship in containers with Docker for Beginners. Membership unlocks every course.