{} The Go Reference

Under the hood

Go Internals, Explained

You know how to write Go — now learn how it runs. From the stack and heap to escape analysis, the garbage collector, the itab behind every interface, and the goroutine scheduler — each page pairs a clear mental model with code you can run right here and the runtime knobs worth knowing.

Your internals progress

Mark a topic “learned” on its page and watch the bars fill.

Skill map

Learned nodes light up — the glowing one is your next step. Click any node to jump in.

Memory & Garbage Collection

Where values live and die — stack vs heap, escape analysis, the size-class allocator, and the concurrent tricolor garbage collector.

Value Representation

How Go lays out data in memory — struct padding and alignment, unsafe.Pointer and the rules around it, and the itab/eface behind every interface.

Execution & Runtime

How your program actually runs — the M:N goroutine scheduler down to sysmon and preemption, and observing the live runtime with metrics and GODEBUG.

Compiler & Toolchain

From source to binary — the compile and link pipeline, build modes and binary anatomy, and reading the assembly the compiler emits.

Revise

REFERENCE · Reference Go Internals Cheat-Sheet

One-page map of Go internals — memory, GC, value representation, the scheduler, and the toolchain, plus the runtime and GODEBUG knobs worth memorizing.

One-page recap · ⏱ 4 min

🐹 You rarely need this to write Go — but it explains everything

Go hides the runtime on purpose: you allocate without thinking about the heap, spawn goroutines without touching a thread. But when you chase a memory leak, a latency spike, or a surprising allocation, these are the mechanics that explain why — and the runtime, unsafe and go tool knobs that let you see and shape them.