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.
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.
Where Go values live — the fast per-goroutine stack vs the garbage-collected heap, why stacks grow and get copied, and how the compiler (not you) decides.
✦ Complete · ⏱ 6 min 2 · Intermediate Escape AnalysisHow the compiler decides whether a value lives on the stack or escapes to the heap — reading go build -gcflags=-m, the patterns that cause escapes, and why it matters for performance.
✦ Complete · ⏱ 6 min 3 · Advanced The Memory AllocatorHow Go serves memory without a syscall every time — the tiered allocator (mcache/mcentral/mheap), size classes, and the tiny-object allocator.
✦ Complete · ⏱ 7 min 4 · Advanced The Garbage CollectorGo's concurrent garbage collector — tricolor mark-and-sweep, write barriers, the GOGC and GOMEMLIMIT knobs, and how to trade speed against footprint.
✦ Complete · ⏱ 6 minValue 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.
How Go lays structs out in memory — alignment and padding, field ordering, unsafe.Sizeof/Alignof/Offsetof, and cache lines.
✦ Complete · ⏱ 5 min 6 · Advanced unsafe & PointersUsing the unsafe package responsibly — unsafe.Pointer and uintptr, the four valid patterns, and why a moving garbage collector makes uintptr addresses dangerous.
✦ Complete · ⏱ 5 min 7 · Advanced Interfaces: itab & efaceHow interfaces are really represented — the iface and eface structures, itab caching, dynamic dispatch and type-assertion cost — deeper than the fundamentals page.
✦ Complete · ⏱ 5 minExecution & 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.
Below the M:N model — the sysmon monitor thread, preemption, the netpoller, and work-stealing with handoff — deeper than the concurrency scheduler page.
✦ Complete · ⏱ 7 min 9 · Intermediate Runtime IntrospectionObserve the live runtime from inside your program — runtime.MemStats, the modern runtime/metrics package, and GODEBUG knobs like gctrace and schedtrace.
✦ Complete · ⏱ 6 minCompiler & Toolchain
From source to binary — the compile and link pipeline, build modes and binary anatomy, and reading the assembly the compiler emits.
From source to a binary — the compiler stages (parse, type-check, SSA, codegen), the linker, build modes, and what actually ends up inside a Go executable.
✦ Complete · ⏱ 6 min 11 · Advanced Reading AssemblyReading what the compiler emits — go tool compile -S, Go's abstract assembly syntax, //go:noinline, intrinsics, and when looking at assembly actually pays off.
✦ Complete · ⏱ 5 min 12 · Reference Go Internals Cheat-SheetOne-page map of Go internals — memory, GC, value representation, the scheduler, and the toolchain, plus the runtime and GODEBUG knobs worth memorizing.
✦ Complete · ⏱ 4 minRevise
🐹 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.