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
gocommand. - Basics — syntax, variables, types, numbers, conversions, constants and
iota, operators, formatted printing and reading input. - Control Flow —
if,switch,for,range, and labelledbreakandcontinue. - Strings — bytes, runes and UTF-8, the
stringsandstrconvpackages, building text and regular expressions. - Collections — arrays, slices and how they work underneath, the
slicespackage, maps and sorting. - Functions — multiple results, variadic functions, closures,
deferand 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 andcontext. - Standard Library — files, readers and writers, JSON (including the new
json/v2), time, HTTP servers and clients, command-line tools andslog. - 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
Basics
- Syntax and Comments
- Variables
- Basic Types
- Numbers and Math
- Type Conversion
- Constants and iota
- Operators
- Formatted Printing with fmt
- Reading Input
Control Flow
Strings
- Strings, Bytes and Runes
- The strings Package
- Converting with strconv
- Building Strings
- Regular Expressions
Collections
Functions
Types & Methods
- Structs
- Pointers
- Methods
- Embedding and Composition
- Interfaces
- Type Assertions and Type Switches
- Useful Standard Interfaces
- Packages and Visibility
Errors
Generics & Iterators
Concurrency
- Goroutines
- Channels
- select and Timeouts
- WaitGroups, Mutexes and Data Races
- Concurrency Patterns
- Cancellation with context
Standard Library
- Files and Directories
- Readers and Writers
- JSON
- Dates and Times
- HTTP Servers
- HTTP Clients
- Command-Line Tools
- Logging with slog
Tools & Projects
- Testing
- Benchmarks and Profiling
- What's New in Go 1.27
- Best Practices and Tooling
- Project: A Task Tracker API