Learn Go the way a systems engineer needs it: what every value looks like in memory, what the allocator, garbage collector and scheduler do on your behalf, how to measure and speed up a program — and how to build neural networks, tokenizers, LLM clients and model servers in it.
Every other path in this library writes its code in Go. This is the path about Go itself. It starts at “what is a variable” and ends with a transformer forward pass and a batching model server, both written from nothing but the standard library.
It assumes you have programmed in some language. It does not assume you know Go, C, or how a garbage collector works.
How this course works#
Every lesson follows the same shape:
- The idea in one minute — the whole lesson in a few sentences.
- An analogy — something from everyday life with the same shape.
- A picture — a hand-drawn diagram, usually of memory.
- How it really works — the precise version, with real sizes and names.
- Code — a small Go program you can run. Nearly all of them measure the thing the lesson claims, so you never have to take the text’s word for it.
- Remember this — the three or four facts worth keeping.
- Try it and Check yourself — exercises and questions.
Why draw memory?#
Most Go surprises are memory surprises: a slice that changes behind your back, an interface that is “nil but not nil”, a goroutine that leaks, a program that spends a third of its time in the garbage collector. Each one stops being a surprise once you can draw the bytes.
flowchart TB
SRC["Your code<br/>values, pointers, goroutines"] --> CMP["Compiler<br/>escape analysis, inlining"]
CMP --> BIN["One static binary<br/>your code + the runtime"]
subgraph RT["The Go runtime, inside your process"]
SCH["Scheduler<br/>goroutines onto threads"]
ALC["Allocator<br/>size classes, spans"]
GC["Garbage collector<br/>concurrent mark and sweep"]
end
BIN --> RT
RT --> OS["Operating system<br/>threads, memory pages, sockets"]
class SRC neutral
class CMP,BIN compute
class SCH queue
class ALC,GC memory
class OS ioThe path#
flowchart LR I["I The language"] --> II["II Data in memory"] II --> III["III Memory"] III --> IV["IV Concurrency"] IV --> V["V Performance"] V --> VI["VI AI in Go"] class I neutral class II,III memory class IV queue class V compute class VI io
| Module | You will be able to | Level |
|---|---|---|
| I — The Language | Read and write idiomatic Go: values, functions, errors, structs, interfaces, packages, tests | Foundations |
| II — Data in Memory | Draw a slice, string, map, struct and interface as bytes, and predict what a copy shares | Basic |
| III — Memory | Explain stack vs heap, read escape analysis, describe the allocator and the garbage collector, and cut allocations | Intermediate |
| IV — Concurrency | Explain the scheduler, use channels, context and sync correctly, and reason about data races | Intermediate |
| V — Performance | Benchmark and profile, read what the compiler did, lay out data for the cache, and know what cgo and SIMD cost | Advanced |
| VI — AI in Go | Build tensors, a trained neural network, a tokenizer, a transformer forward pass, an LLM client, vector search and a batching model server | Expert |
| Projects | Build six programs that make the ideas stick | All |
What you need#
- Go 1.22 or newer. Every runnable program in the course builds with it. Lessons mark the few features that need a newer release and show them as snippets.
- A terminal. No other tools, no GPU, no Python.
Getting started in fifteen minutes#
- Install Go from go.dev/dl and run
go version. - Read I.01 and run its program with
go run. - If you already write Go, start at II.01 — module II is where the pictures begin — or go straight to III.02 Escape analysis.
- If you came for the AI part, read VI.01 first; it says which earlier lessons each AI lesson leans on.
A note on versions#
Go releases every six months and keeps a strict compatibility promise: code written for Go 1.0 still compiles. The language changes slowly; the runtime improves constantly. On 3 October 2026, when this course was last checked, the current release was Go 1.27 (August 2026). What recent releases changed, in the order the course meets them:
| Release | What changed | Lesson |
|---|---|---|
| 1.22 (Feb 2024) | Each loop iteration gets its own variable; range over an integer | I.03 |
| 1.23 (Aug 2024) | Range over functions (iterators) | II.06 |
| 1.24 (Feb 2025) | Maps rebuilt as Swiss tables; testing.B.Loop; weak pointers | II.03, V.01 |
| 1.25 (Aug 2025) | GOMAXPROCS respects container CPU limits; testing/synctest; sync.WaitGroup.Go | IV.01, IV.04 |
| 1.26 (Feb 2026) | “Green Tea” garbage collector on by default; new(expr); cheaper cgo calls | III.04, V.04 |
| 1.27 (Aug 2026) | Generic methods; encoding/json/v2; faster small allocations; goroutine-leak profile | II.06, III.03, IV.06 |
Runtime internals — sizes, thresholds, algorithms — are implementation details and do change. Wherever the course quotes one, the program beside it measures it on your machine.
Sister paths#
- Inference Engineering — the serving systems most of module VI points toward.
- GPU Engineering — the hardware underneath.
- Observability Engineering — measuring what you build here once it is running.