Go
42 notes
Some notes are currently available only in Chinese. English translations are shown when available.
- Go Arrayshistorical
Fixed-length value types, copying semantics, indexing, iteration, and their relationship to slices.
- Go Sliceshistorical
Slice descriptors, backing arrays, append/capacity, sharing, copying, and retention pitfalls.
- Go deferhistorical
Deferred calls, LIFO execution, argument evaluation, return interaction, and practical cleanup patterns.
- 2.1 Contexthistorical
Go context trees for cancellation, deadlines, timeouts, and request-scoped values, with lifecycle rules for passing and canceling contexts.
- 2.2 sync.WaitGrouphistorical
Waiting for a group of goroutines to finish with Add, Done, and Wait, including the counter lifecycle and common Add/Wait misuse.
- 2.3 The sync Packagehistorical
A map of Go's shared-memory synchronization primitives: Mutex, RWMutex, Once, Cond, Map, Pool, WaitGroup, and atomic operations.
- 2.4 sync.Maphistorical
Go's specialized concurrent map, its intended workloads, read-optimized internal design, atomic map operations, and when a normal map plus mutex is clearer.
- sync.Poolhistorical
Temporary object reuse, GC interaction, per-P optimization, and when pooling helps.
- 2.6 Selecthistorical
How Go `select` waits on multiple channel operations, chooses among ready cases, uses `default`, handles nil channels, timeouts, and cancellation.