Tutorials
Practical tutorials for the work we actually do. Pick one, read it in order, and apply it.
Use type parameters with comparable and cmp.Ordered alongside Go's standard slices and maps packages. After this, you eliminate duplicate helpers without losing type safety.
Wrap multi-step SQL writes in db.BeginTx with defer tx.Rollback() and bound database connections with SetMaxOpenConns.
Avoid accumulating uncollected timers in busy select loops by using time.NewTicker and stopped time.NewTimer instances. After this, polling loops keep memory flat under load.
Replace external dependencies with small consumer-side interface fakes, use t.TempDir() for scratch files, and load fixtures from testdata/.
Write FuzzX(f *testing.F) targets and run go test -fuzz to discover edge-case panics and automatically save regression cases under testdata/fuzz.
Inspect heap escapes with go build -gcflags=-m and set GOGC and GOMEMLIMIT to prevent container OOM kills. After this, memory usage and GC behavior are predictable in production.
Capture -mutexprofile and -trace outputs from Go benchmarks to pinpoint lock contention and scheduler stalls. After this, you spot hidden blocking waits that CPU profiles miss.
Inspect struct fields and tags at runtime with reflect.TypeOf, and decide when generics or go generate are a better fit.