Go
A simple, fast language for cloud and servers
Learn Go from scratch: from your first program and basic types to functions, slices, maps, structs and interfaces. Then you will master handling errors as values and writing concurrent programs with goroutines and channels. At the end of the course you will build a small REST API service with modules, tests and the standard library.
Course content
Go basics
BeginnerInstall Go, run your first program and get to know variables, types, conditions and loops.
- 1What is Go? Your first programFind out why Go was created and where it is used, install it and run your first program with `go run`.12 min
- 2Variables, types and constantsDeclare variables with `var` and `:=`, and learn the basic types, zero values, conversions, strings and constants with `iota`.14 min
- 3Conditions, loops and switchMake decisions with `if` and its init statement, and learn every form of `for` — Go's only loop — and a `switch` that needs no `break`.14 min
Functions and collections
BeginnerWrite functions with several results, closures and defer, and work with arrays, slices and maps.
- 4Functions, closures and deferWrite functions with several results, named results and variadic parameters, and learn closures and `defer`, which saves work for the end of a function.15 min
- 5Arrays, slices and mapsLearn fixed-size arrays, slices that grow with `append` and their hidden traps, and maps that store key–value pairs.18 min
Types, interfaces and errors
IntermediateBuild your own types with structs, methods, pointers, interfaces and generics, and handle errors the Go way.
- 6Structs, methods and pointersBuild your own types with structs, understand why pointers are needed, write methods with value and pointer receivers, and use composition.16 min
- 7Interfaces and genericsWork with implicitly satisfied interfaces, `any`, type assertions and type switches, and write generic functions and types.18 min
- 8Error handlingUnderstand why errors are ordinary values in Go and learn to use `errors.New`, `fmt.Errorf` with `%w`, `errors.Is` and `errors.As`, as well as `panic` and `recover`.16 min
Concurrency and a real project
AdvancedUse goroutines, channels and mutexes, then build a complete project with modules, tests and a REST API.
- 9Goroutines, channels and syncRun work concurrently with goroutines, pass data with channels and `select`, synchronise with `WaitGroup` and `Mutex`, and build a worker pool.22 min
- 10Modules, tests and a REST API projectCreate modules and packages, explore the standard library, write table-driven tests and build a small REST API for tasks with `net/http`.25 min