Go Deep Dives Overview
Go Deep Dives Overview
Diagram: Deep-dive stack
flow:
[Comp]
|
v
[RT]
[RT]
|
v
[OS]
This part is for readers who already write idiomatic Go and want the runtime, toolchain, and production mental models behind real symptoms: latency cliffs, leaks, interface nil traps, timer churn, cgo taxes, and “why is this slow in the pod?”
Earlier parts teach how to use the language. These chapters teach how the machine runs it — deep enough to debug, not a full fork of src/runtime.
Who This Part Is For
- You have shipped Go services or tools
- You can read basic
pprof/traceoutput - You want code → runtime structures → observables
If you are still learning syntax, finish Core, Memory, and Concurrency first.
Learning Paths
A — Runtime core
201 GMP → 202 memory model → 203 channels → 213 netpoll → 214 timers → 227 mutex → 239 sysmon
B — Data representation
204 interfaces → 205 slice/map → 218 Swiss maps → 235 strings/bytes → 217 weak/unique → 236 errors
C — Execution control
206 defer/panic → 215 stacks → 226 context → 220 leaks → 223 synctest
D — Performance & GC
208 GC → 219 pool/zero-alloc → 222 pprof/trace → 224 zero-copy → 209 compiler/PGO → 243 GOMAXPROCS/cgroup
E — Toolchain & platforms
210 link/race → 228 cgo → 230 ABI → 231 coverage/fuzz → 232 build cache → 233 experiments → 234 Wasm → 244 plugins
F — Production craft
225 HTTP transport → 241 TLS → 242 slog handlers → 237 mistakes → 238 debugging → 240 reading source → 245 topic radar
Full Chapter Map
| # | Topic |
|---|---|
| 201 | Scheduler (GMP) |
| 202 | Memory model / happens-before |
| 203 | Channels & select |
| 204 | Interfaces (eface/iface) |
| 205 | Slice & map headers |
| 206 | Defer, panic, unwind |
| 207 | Generics implementation |
| 208 | GC internals & pacer |
| 209 | Compiler, SSA, PGO |
| 210 | Link, buildmodes, race |
| 211 | Reflect cost |
| 212 | Modules, MVS, toolchain |
| 213 | Netpoller |
| 214 | Timers / time.After |
| 215 | Stack growth |
| 216 | Finalizers & cleanup |
| 217 | weak & unique |
| 218 | Swiss maps & maphash |
| 219 | sync.Pool & zero-alloc |
| 220 | Goroutine leaks |
| 221 | GODEBUG knobs |
| 222 | pprof & tracer internals |
| 223 | testing/synctest (bubbles, durable blocks, fake time) |
| 224 | Zero-copy I/O |
| 225 | HTTP Transport pool |
| 226 | Context cancel trees |
| 227 | Mutex / semaphore runtime |
| 228 | cgo + Go 1.26 scheduler |
| 229 | Iterators / range-over-func |
| 230 | ABI & assembly |
| 231 | Coverage & fuzz engine |
| 232 | Build cache / reproducibility |
| 233 | GOEXPERIMENT catalog |
| 234 | Wasm / wasip1 |
| 235 | String / []byte internals |
| 236 | Error interface cost |
| 237 | Production mistakes map |
| 238 | Production debugging |
| 239 | sysmon & scavenger |
| 240 | Reading runtime source |
| 241 | TLS handshake path |
| 242 | slog handler design |
| 243 | GOMAXPROCS & cgroups |
| 244 | Plugin buildmode pitfalls |
| 245 | X/ecosystem topic radar |
| 246 | Internals-for-Interns article radar |
| 247 | Memory allocator (mcache/mcentral/mheap) |
| 248 | Runtime bootstrap |
| 249 | select + selectgo |
| 250 | Stacktraces + binary metadata |
| 251 | mmap vs pread storage I/O |
| 252 | Compiler frontend (scan/parse/types) |
| 253 | Compiler IR / SSA / link |
| 254 | Race detector internals |
| 255 | Write barriers & mark assist |
| 256 | Work stealing / findrunnable |
| 257 | Type assert / convert runtime |
| 258 | OS signals & runtime |
| 259 | HTTP/2 in Go |
| 260 | database/sql pool |
| 261 | JSON performance |
| 262 | errgroup patterns |
Stack Diagram
your code
|
v
compiler (types, SSA, inlining, escape, PGO)
|
v
runtime (scheduler, poller, timers, maps, GC, defer, cgo)
|
v
OS threads + cgroups + network stack + TLS
Diagrams in this part
Prefer ASCII diagrams in fenced text blocks (works in HTML, PDF, and EPUB). Flagship topics also ship optional SVG under content/20-go-deep-dives/assets/ for HTML. Mermaid is not required for this part.
Study Method
hypothesis -> minimal repro -> measure (pprof/trace/race) -> model -> fix ownership/allocs/timeouts
- One chapter, one question.
- Run the experiment; change one knob.
- Confirm with tools, not vibes.
Relationship to Other Parts
| Concern | Prefer |
|---|---|
| Concurrency patterns | Part 07 + 201/203/220 |
| GC knobs tutorial | Part 03/18 + 208/239 |
| Profiling workflow | Part 18 + 222/238 |
| Stdlib how-to | Part 98 |
| HTTP resilience | Part 13 + 225/241 |
| Security TLS ops | Part 17 + 241 |
Honesty Boundary
Runtime details evolve (scheduler, GC, maps, experiments). Chapters teach stable models and version-labeled notes (e.g. Go 1.26 Green Tea GC, P-syscall simplification; Go 1.27 size-specialized malloc and goroutineleak). Pseudocode is a map for reading source — not a bit-identical clone of src/runtime.
Checklist: Deep-Dive Literacy
- Draw G/M/P and explain work stealing
- State happens-before for unlock→lock and send→receive
- Explain typed-nil interface trap
- Fix a goroutine leak with context
- Replace hot
time.Afterwith timer reuse - Tune or justify GOMAXPROCS under cgroup limits
- Read one CPU + one goroutine profile
- Find a panic string in
GOROOT/src/runtime - Know when cgo/plugins/Wasm are the wrong tool
When most boxes are automatic, you can track Go releases without fear.