Go Course

Go is the compiled, concurrent language behind Docker, Kubernetes, Terraform and much of today's cloud infrastructure. This course teaches modern Go 1.27 from your first program through slices, maps, structs, interfaces and error handling to generics, iterators, goroutines and channels, and on to files, JSON, HTTP servers and clients, testing and profiling — finishing with a complete, tested JSON web API.

What you'll learn

The course has 69 lessons in twelve parts:

  • Getting Started — what Go is, installing it, running and building programs, modules and the go command.
  • Basics — syntax, variables, types, numbers, conversions, constants and iota, operators, formatted printing and reading input.
  • Control Flow — if, switch, for, range, and labelled break and continue.
  • Strings — bytes, runes and UTF-8, the strings and strconv packages, building text and regular expressions.
  • Collections — arrays, slices and how they work underneath, the slices package, maps and sorting.
  • Functions — multiple results, variadic functions, closures, defer and recursion.
  • Types & Methods — structs, pointers, methods, embedding, interfaces, type switches and packages.
  • Errors — returning, wrapping and inspecting errors, and panic/recover.
  • Generics & Iterators — generic functions and types, Go 1.27's generic methods, and range-over-func iterators.
  • Concurrency — goroutines, channels, select, mutexes and the race detector, worker pools and context.
  • Standard Library — files, readers and writers, JSON (including the new json/v2), time, HTTP servers and clients, command-line tools and slog.
  • Tools & Projects — testing, benchmarks and profiling, what's new in Go 1.27, best practices and a final project.

Every example in the course was compiled and run with Go 1.27, and the output shown is exactly what it produced. Examples that are meant to fail show the compiler's or go vet's real message. The Try it yourself editors let you change any example and copy it to run on your own computer.

No previous programming experience is required, although Go moves quickly through the basics; if you've never programmed before, our Python course is a gentler start.

Practice

  • Playground — a starter program to copy and experiment with.
  • Exercises — fill-in-the-blank tasks and programming challenges with solutions.
  • Quiz — test your understanding across the whole course.
  • Syllabus & Study Plan — learning outcomes and a week-by-week schedule.

Lessons

Getting Started

  1. Introduction to Go
  2. Installing Go
  3. Your First Go Program
  4. The go Command and Modules

Basics

  1. Syntax and Comments
  2. Variables
  3. Basic Types
  4. Numbers and Math
  5. Type Conversion
  6. Constants and iota
  7. Operators
  8. Formatted Printing with fmt
  9. Reading Input

Control Flow

  1. if and else
  2. switch
  3. for Loops
  4. Looping with range
  5. break, continue and Labels

Strings

  1. Strings, Bytes and Runes
  2. The strings Package
  3. Converting with strconv
  4. Building Strings
  5. Regular Expressions

Collections

  1. Arrays
  2. Slices
  3. How Slices Work
  4. The slices Package
  5. Maps
  6. Sorting

Functions

  1. Functions
  2. Multiple Return Values
  3. Variadic Functions
  4. Function Values and Closures
  5. defer
  6. Recursion

Types & Methods

  1. Structs
  2. Pointers
  3. Methods
  4. Embedding and Composition
  5. Interfaces
  6. Type Assertions and Type Switches
  7. Useful Standard Interfaces
  8. Packages and Visibility

Errors

  1. Errors
  2. Wrapping and Inspecting Errors
  3. panic and recover

Generics & Iterators

  1. Generic Functions
  2. Generic Types and Constraints
  3. Generic Methods
  4. Iterators

Concurrency

  1. Goroutines
  2. Channels
  3. select and Timeouts
  4. WaitGroups, Mutexes and Data Races
  5. Concurrency Patterns
  6. Cancellation with context

Standard Library

  1. Files and Directories
  2. Readers and Writers
  3. JSON
  4. Dates and Times
  5. HTTP Servers
  6. HTTP Clients
  7. Command-Line Tools
  8. Logging with slog

Tools & Projects

  1. Testing
  2. Benchmarks and Profiling
  3. What's New in Go 1.27
  4. Best Practices and Tooling
  5. Project: A Task Tracker API

Practice

  1. Go Playground
  2. Go Exercises
  3. Go Quiz
  4. Syllabus & Study Plan
Where to start: begin with Introduction and install Go in lesson 2 so you can run every example yourself. Afterwards, learn to design the databases your services use with our SQL course, or keep your projects under version control with Git.