Go (Golang)

Learn Go by running it: modules and packages, types and zero values, slices and maps, structs, interfaces and generics, errors, goroutines, channels, context, the race detector, net/http, JSON, testing and tooling, all executed with Go 1.27.

Start course →

What you'll learn

  • Write, run and organise Go programs with modules, packages and the go command.
  • Use Go's types, zero values, slices, maps, structs, methods, interfaces and generics correctly.
  • Handle errors idiomatically with wrapping, errors.Is and errors.As, and use defer and recover.
  • Write concurrent code with goroutines, channels, select, context and mutexes, and find races with -race.
  • Build HTTP services and JSON APIs with the standard library.
  • Test, vet and format Go code, and structure projects for production.

Syllabus

Getting Started With Go

  1. Why Go
  2. Hello, World and the go Command
  3. Modules and Packages

Language Basics

  1. Variables, Constants and Zero Values
  2. Control Flow
  3. Functions, Multiple Returns and Closures
  4. Slices and Maps

Structs, Interfaces and Generics

  1. Structs and Methods
  2. Interfaces
  3. Generics

Errors, defer and panic

  1. Wrapping and Inspecting Errors
  2. defer, panic and recover
  3. Designing Errors

Concurrency

  1. Goroutines and WaitGroups
  2. Channels and Pipelines
  3. select, Timeouts and context
  4. Data Races, Mutexes and the Race Detector

The Standard Library for Services

  1. HTTP Servers With net/http
  2. JSON With Struct Tags
  3. Time and Formatting

Testing and Tooling

  1. Table-Driven Tests
  2. go vet
  3. gofmt and Consistent Style

Building Real Services

  1. Project Structure and Dependencies
  2. Graceful Shutdown and Observability
  3. A Go Code Review Checklist