๐งฑ Tier 1 ยท Orient
The Stack Map
The Go stack, layer by layer, with one current-best pick each. Concepts are durable; tools are swappable โ every pick is dated, so replace it without relearning the layer.
Language & runtime
since 2024The language itself, its garbage collector, and scheduler.
Go 1.22+
1.22 fixed the loop-variable capture footgun and added range-over-integer; 1.21 added the cmp/slices/maps packages. Stay on a recent toolchain โ upgrades are cheap and backward-compatible.
Dependencies & build
since 2019Resolve packages, pin versions, produce a binary.
Go modules + the go command
go.mod / go.sum are built in; `go build` cross-compiles with GOOS/GOARCH and needs no external build tool. Reach for a Makefile only to script multi-step tasks.
Testing
since 2012Prove behavior; benchmark; detect races.
stdlib testing (table-driven) + go test -race
The standard library is enough for almost everything. Add testify/require only if you want terser assertions; reach for a mocking lib rarely โ small interfaces + hand-written fakes beat generated mocks.
Lint & static analysis
since 2023Catch bugs the compiler allows.
golangci-lint (bundles go vet, staticcheck, โฆ)
Run go vet always; golangci-lint aggregates the high-value linters behind one config and one command. staticcheck alone is a great minimal step up.
HTTP & routing
since 2024Serve and route HTTP.
net/http ServeMux (1.22); chi for middleware
1.22's ServeMux added method + wildcard patterns, so the stdlib covers most APIs. Reach for chi when you want composable middleware stacks; full frameworks (echo, gin) only when you want batteries included.
Persistence
since 2023Talk to a database with type safety.
pgx + sqlc (Postgres)
database/sql is the portable baseline; pgx is the fast Postgres driver, and sqlc generates type-safe Go from your SQL. Reach for an ORM (GORM) only when you want convenience over control.
Configuration & CLI
since 2012Parse flags, env, and subcommands.
flag (stdlib); cobra for multi-command CLIs
The stdlib flag package handles simple tools. cobra (+ viper for config) earns its weight once you have many subcommands and rich help.
Logging
since 2023Structured, leveled logs.
log/slog
slog landed in the stdlib in 1.21 โ structured key/value logging with levels and handlers. No reason to add zap/zerolog unless you've measured a hot-path allocation problem.
Concurrency tooling
since 2023Coordinate goroutines safely.
go test -race + golang.org/x/sync (errgroup)
The race detector is non-negotiable in CI. errgroup gives you bounded fan-out with first-error cancellation; semaphore caps concurrency when a worker pool is overkill.
Observability
since 2024Profile and trace in production.
net/http/pprof + OpenTelemetry
pprof ships with the runtime โ CPU, heap, goroutine, and block profiles for free. OpenTelemetry is the vendor-neutral choice for traces and metrics across services.
Build & ship
since 2022Package the binary for production.
multi-stage Docker โ distroless/static
A static Go binary (CGO_ENABLED=0) drops into a distroless or scratch image for a tiny, attack-surface-minimal container. ko is a nice alternative that skips the Dockerfile entirely.