Go course

Every lesson to learn Go, from your first program to interfaces and error handling, organised by level.

Beginner

1Beginner

Introduction to Go

Discover what the Go programming language is, its origins at Google, its strengths for cloud and network services, and the traits that define it.

9 min read

2Beginner

Installing Go

A step-by-step guide to installing Go on Windows, macOS and Linux, verifying the setup with go version, and understanding modules and workspaces.

10 min read

3Beginner

Your first Go program

Create a Go module, write a runnable Hello World in main.go, then run and build it while learning package main, imports and the func main entry point.

11 min read

4Beginner

Variables and types in Go

Learn how to declare and use variables in Go with var, the short := operator, type inference and zero values, with runnable examples.

12 min read

5Beginner

Conditionals in Go

Learn to control the flow of a Go program with if, else if and else, the if-with-statement form, and switch, with clear runnable examples.

12 min read

6Beginner

Loops in Go

Master Go's only loop keyword, for: the three-component form, while-style and infinite loops, for range over slices and maps, plus break, continue and labels.

12 min read

7Beginner

Functions in Go

Learn to write functions in Go: parameters and typed returns, multiple and named return values, variadic functions, closures, and the result-error convention.

14 min read

8Beginner

Arrays and slices in Go

Understand arrays and slices in Go: slice literals, len and cap, append, slicing, make, ranging, and how slices share a backing array.

14 min read

Intermediate

9Intermediate

Maps in Go

Learn how to create and use maps in Go: literals and make, the comma-ok idiom, delete, len and ranging over keys, with a runnable word-count example.

14 min read

10Intermediate

Structs and methods in Go

Learn to define structs in Go, use fields and struct literals, embed structs, and write value and pointer receiver methods, with a runnable example.

15 min read

11Intermediate

Interfaces in Go

Learn how interfaces work in Go: implicit satisfaction, the empty interface any, type assertions, and a Stringer example, with runnable code.

15 min read

12Intermediate

Error handling in Go

Learn idiomatic error handling in Go: the error interface, returning and checking errors, errors.New, wrapping with %w, errors.Is and errors.As.

16 min read

Search

Search runs entirely in your browser.