Implementation Principles
These chapters explain how Go works under the hood. They are written for readers who already know the language basics and want to understand the runtime instead of treating it as a black box.
Data Structures
- Slices — the slice header, growth strategy and shared backing arrays
- Map — hash buckets, overflow buckets and incremental expansion
- Strings — string headers, concatenation and conversions
- Channel — the
hchanstructure and its send/receive queues - Select — how
selectpicks a ready case - sync.Map — the read/write map split used for concurrent access
Runtime
- GMP Scheduler — goroutines, Ms and Ps, and how work is scheduled
- Memory Allocator — spans, arenas and size classes
- Garbage Collection — tri-color marking, write barriers and stop-the-world pauses
- sysmon — the background monitor thread
Error Handling
- nil — what
nilis and when comparisons surprise you - defer — how deferred calls are registered and executed
- panic — the panic/recover mechanism
Concurrency Primitives
Networking
- netpoll — the network poller behind non-blocking I/O
