Go course
GO
Go course: Getting started
What Go is, the toolchain, the first program, modules and packages, types and constants, and conditions.
Open →
Go course: Loops, functions and data
Loops and closures, errors as values, pointers, arrays and slices, maps, strings and runes, structs and methods.
Open →
Go course: Interfaces, generics and errors
Interfaces and type switches, embedding, type parameters, wrapping errors, defer and panic, recursion and sorting.
Open →
Go course: Testing and debugging
go test and table tests, testify, httptest, fakes and mocks, golden files, fuzzing, benchmarks and profiling.
Open →
{ }
Go course: Modules, build and tooling
Versions and go.sum, workspaces, build tags and embed, cross-compiling, cgo, unsafe, linker flags, layout and CI.
Open →
Go course: Concurrency
Goroutines and the scheduler, channels and select, sync primitives, context, worker pools, pipelines and races.
Open →
Go course: The standard library
fmt scanning, io and bufio, files and paths, flags, time, regexp, JSON and CSV, templates and log/slog.
Open →
API
Go course: Networking and services
An HTTP server and its handlers, middleware, a client, a JSON API, templates, shutdown, database/sql, migrations and timeouts.
Open →
Go course: Reflection and internals
Reflection and struct tags, the memory model, escape analysis, the garbage collector, runtime traces and compiler directives.
Open →
Go course: Capstone 1, a JSON reader and writer
A JSON tokenizer, parser, value type and writer, with errors and positions, table tests, a command and benchmarks.
Open →
Go course: Capstone 2, a tasks CLI with storage
A task model with JSON storage, the commands, error codes, a fake store, JSON output, profiles and release builds.
Open →
Go course: Capstone 3, an HTTP service
The API and its layout, a store, handlers, middleware and logging, httptest with a fake store, a built frontend, deploy and shutdown.
Open →
The course
A practical course that goes from installing the toolchain to three capstone projects. Every lesson
is a manual: a complete program, the command that builds it, and the output it printed on the machine
described at the end of the lesson. The course is written and published part by part, and the tree
below lists the lessons that are ready to read.
Values, slices and maps come first, then functions, errors and pointers, because they carry every
later decision. Interfaces, generics and the error chain follow, then tests and debugging, the build
and module system, concurrency and the standard library. The last three parts build a JSON parser, a
task manager and an HTTP service, one lesson at a time.
The tools around the tests have their own group:
Testing Go code covers the go test command, assertions and the
libraries, httptest, fakes and mocks, golden files, fuzzing, benchmarks and CI, without repeating the
lessons.
Start with
What Go is and where it runs .
For a short description of the language read
Go basics , and for the tools this course was checked with see
an editor, gofmt, go vet and go doc .
All articles
course/
Getting started (12)
1.1 What Go is and where it runs
1.2 Install Go on Linux, macOS and Windows
1.3 An editor, gofmt, go vet and go doc
1.4 Your first Go program
1.5 A module, go.mod and module paths
1.6 Packages, imports and visibility
1.7 Variables, short declarations and zero values
1.8 Constants, iota and typed constants
1.9 Types, named types and conversions
1.10 Integers, floats and overflow
1.11 Operators, bits and comparisons
1.12 Conditions, switch and case lists
Loops, functions and data (14)
2.1 Loops, range and labels
2.2 Functions, several return values and closures
2.3 Errors as values
2.4 Pointers, nil and the address of a value
2.5 Arrays and fixed-size buffers
2.6 Slices and the array behind them
2.7 append, capacity and shared backing arrays
2.8 Maps: lookup, comma-ok and iteration
2.9 Map internals, hashing and growth
2.10 Strings, bytes and runes
2.11 UTF-8, runes and the strings package
2.12 fmt, verbs and a text table
2.13 Structs, literals and anonymous structs
2.14 Methods, value and pointer receivers
Interfaces, generics and errors (12)
Testing and debugging (12)
Modules, build and tooling (12)
Concurrency (16)
The standard library (14)
Networking and services (12)
Reflection and internals (8)
Capstone 1, a JSON reader and writer (8)
Capstone 2, a tasks CLI with storage (8)
Capstone 3, an HTTP service (7)
Install Go on your system (6)