Dissecting Slices, Maps and Channels in Go
summary
Uses an unsafe scalpel and a microscope function to print runtime memory structures and reproducible code. Shows slices growing from capacity 1 to 8 on appends, how a super-slice window shares memory until a resize causes a disconnect, and that append can overwrite the original backing array. Dumps map internals: buckets of eight slots, B increment on resize, overflow buckets created instead of immediate resize, and gradual migration that doubles buckets. Inspects buffered channels (size 4), send/receive indices, parked goroutines on full/empty buffers, and close semantics.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:13Slices in memory
- 8:58Slice resize surprises
- 10:01Go maps structure
- 16:44Map resizing and overflow
- 20:01Channels memory and buffering
- 26:47Closing channels and waiting
- 27:51Practical takeaways








