Overview
Go's design bet is radical simplicity: a small language, fast compilation, and one first-class concurrency story (goroutines + channels, from Hoare's CSP) baked into the runtime. Going deep means understanding that runtime — the M:N scheduler, the GC, how interfaces dispatch — and the idioms the community has settled on, because Go punishes fighting its grain more than most languages.
Key points
- Goroutines & scheduler: G-M-P model (goroutines multiplexed onto OS threads via per-core run queues), work stealing, preemption; goroutines cost ~KBs — concurrency as a default, not an event.
- Channels & CSP: "share memory by communicating"; buffered vs. unbuffered,
select,context.Contextfor cancellation as the idiom that ties it together;syncpackage when channels are the wrong tool. - Interfaces: implicit satisfaction, small interfaces (
io.Reader) as the design unit; interface values = (type, pointer) pairs — the nil-interface trap. - Memory & GC: escape analysis (stack vs. heap), concurrent tri-color mark-sweep
tuned for low pause over throughput,
GOGC/GOMEMLIMIT. - Error handling & generics: explicit
errorreturns, wrapping with%w,errors.Is/As; generics (1.18+) deliberately modest — used for containers and constraints, not type gymnastics. - Tooling as language feature:
go mod,gofmt(no style debates), race detector, pprof profiling, single-binary cross-compilation. - To explore: runtime internals (netpoller under goroutine I/O), PGO, when Go's simplicity becomes a ceiling (and the workarounds).
Practice
- Go by Example (source) — annotated idiomatic snippets to type through, not read; the fastest route to the community's settled idioms.
- Gophercises (source) — small complete programs (quiz game, URL shortener, link parser) that exercise interfaces, goroutines, and the standard library the way real Go does.
- Coding Challenges in Go (source) —
build your own
wc, Redis, or load balancer; single-binary tooling makes Go the natural vehicle. - Protohackers ladder (source) — the flagship: network servers from echo to shared-state chat to proxy, one goroutine-and-channels pattern per rung, race-detector clean.
Related
- Concurrency and Parallelism — Go is the CSP branch of that crossroads.
- Deep dive Java and Deep dive Rust — the contrasting runtime philosophies.
- Ownership, memory & concurrency in Rust — the compile-time counterpart of this note's GC and scheduler bullets: data races as compile errors where Go ships a race detector.
- GC principles & algorithms — the shared theory behind Go's tri-color collector, and the generational road Go didn't take; The Java Memory Model is the JMM counterpart to Go's happens-before doc.
- Microservice architecture — Go's sweet spot in practice.
- The theme's map: the Go toolchain · compilers & runtimes · modules & build · how Go evolves · web frameworks · testing · protocols · storage · security.