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