go build invokes compile, link, and optimization passes. SSA-based optimizer inlines and removes dead code.
G (goroutine), M (OS thread), P (logical processor): work stealing schedules G onto M with GOMAXPROCS Ps.
Concurrent tri-color mark-and-sweep; write barriers track pointer changes during marking. Tuning env vars exist (GOGC default 100) but measure before changing.
Goroutine stacks start small and grow/shrink as needed (segmented/stack copying historically; continuous stacks in modern Go).
Rare for app code; unsafe.Pointer rules are strict — misuse breaks the type system.
go test -trace=trace.out
go tool trace trace.out
Shows goroutine scheduling and blocking.
go build -buildmode=pie etc. for executables/shared libs on some platforms.$GOMODCACHE stores downloaded modules; go clean -modcache clears it.
The Go 1 compatibility promise keeps old code building on newer toolchains; deprecated APIs linger with warnings in vet or release notes.