Below the API

Learning path

Go Engineering

Go from the first program to the runtime — how values sit in memory, how the allocator, garbage collector and scheduler work, and how to build AI systems in it.

5 levels · 7 modules · 37 topics · ~33h 5m completed ·
Start learning →

The path

  1. Foundations

    Build the mental model.

    5 topics · ~3h 45m

    The Language

    Go is a small language. This module covers all of it that you need daily, quickly, and with one eye already on what each feature costs. Module overview →

    1. Why Go, and the Toolchain30 min
    2. Values, Types and Zero Values45 min
    3. Functions, Errors and Defer50 min
    4. Structs, Methods and Interfaces50 min
    5. Packages, Modules and Testing50 min
  2. Basic

    Understand the core mechanisms.

    6 topics · ~5h

    Data in Memory

    Module I said slices, strings, maps and interfaces are "small headers that point elsewhere". This module draws each header, byte by byte, and shows what follows from the drawing. Module overview →

    1. Arrays and Slices55 min
    2. Strings, Bytes and Runes45 min
    3. Maps50 min
    4. Pointers and Struct Layout50 min
    5. Interfaces Under the Hood50 min
    6. Generics and Iterators50 min
  3. Intermediate

    Learn the optimization techniques.

    11 topics · ~10h 25m

    Memory

    Go manages memory for you. This module explains exactly how, because the difference between a service that spends 2% of its CPU on memory management and one that spends 30% is almost always … Module overview →

    1. Stack and Heap45 min
    2. Escape Analysis55 min
    3. The Allocator1h
    4. The Garbage Collector1h 10m
    5. Writing Allocation-Aware Code55 min
    Concurrency

    Goroutines are why most people choose Go. This module explains what one actually is, how the runtime runs millions of them on a handful of threads, and how to write concurrent code that is … Module overview →

    1. Goroutines and the Scheduler1h
    2. Channels55 min
    3. Select, Context and Cancellation55 min
    4. Sync and Atomics55 min
    5. The Memory Model and Data Races50 min
    6. Concurrency Patterns1h 5m
  4. Advanced

    Study systems at production scale.

    5 topics · ~4h 40m

    Performance

    Modules III and IV explained what the runtime does. This module is about measuring a program, understanding what the compiler and the CPU did with it, and making it faster on purpose. Module overview →

    1. Benchmarking and Profiling1h
    2. The Compiler55 min
    3. Cache-Friendly Data55 min
    4. cgo, SIMD and Assembly55 min
    5. Networking and the Netpoller55 min
  5. Expert

    Design platforms and read the frontier.

    9 topics · ~9h 15m

    AI in Go

    Everything so far, applied. This module builds the core pieces of an AI system in Go using nothing but the standard library: the arithmetic, a network that learns, a tokenizer, a transformer … Module overview →

    1. Go in the AI Stack40 min
    2. Tensors and Matmul1h 5m
    3. A Neural Network from Scratch1h 10m
    4. A Tokenizer55 min
    5. A Transformer Forward Pass1h 30m
    6. Calling LLMs1h
    7. Embeddings and Vector Search1h
    8. Serving Models from Go1h 5m
    9. A Tool-Calling Loop50 min

Build

Reference

About this path

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:

  1. The idea in one minute — the whole lesson in a few sentences.
  2. An analogy — something from everyday life with the same shape.
  3. A picture — a hand-drawn diagram, usually of memory.
  4. How it really works — the precise version, with real sizes and names.
  5. 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.
  6. Remember this — the three or four facts worth keeping.
  7. 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 io

The 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
ModuleYou will be able toLevel
I — The LanguageRead and write idiomatic Go: values, functions, errors, structs, interfaces, packages, testsFoundations
II — Data in MemoryDraw a slice, string, map, struct and interface as bytes, and predict what a copy sharesBasic
III — MemoryExplain stack vs heap, read escape analysis, describe the allocator and the garbage collector, and cut allocationsIntermediate
IV — ConcurrencyExplain the scheduler, use channels, context and sync correctly, and reason about data racesIntermediate
V — PerformanceBenchmark and profile, read what the compiler did, lay out data for the cache, and know what cgo and SIMD costAdvanced
VI — AI in GoBuild tensors, a trained neural network, a tokenizer, a transformer forward pass, an LLM client, vector search and a batching model serverExpert
ProjectsBuild six programs that make the ideas stickAll

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#

  1. Install Go from go.dev/dl and run go version.
  2. Read I.01 and run its program with go run.
  3. If you already write Go, start at II.01 — module II is where the pictures begin — or go straight to III.02 Escape analysis.
  4. 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:

ReleaseWhat changedLesson
1.22 (Feb 2024)Each loop iteration gets its own variable; range over an integerI.03
1.23 (Aug 2024)Range over functions (iterators)II.06
1.24 (Feb 2025)Maps rebuilt as Swiss tables; testing.B.Loop; weak pointersII.03, V.01
1.25 (Aug 2025)GOMAXPROCS respects container CPU limits; testing/synctest; sync.WaitGroup.GoIV.01, IV.04
1.26 (Feb 2026)“Green Tea” garbage collector on by default; new(expr); cheaper cgo callsIII.04, V.04
1.27 (Aug 2026)Generic methods; encoding/json/v2; faster small allocations; goroutine-leak profileII.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#

↑↓ navigate ↵ open