Tutorials
Practical tutorials for the work we actually do. Pick one, read it in order, and apply it.
Handle SIGINT and SIGTERM with signal.NotifyContext, drain active requests with server.Shutdown(ctx), and test shutdown under -race.
Stop spawning an unbounded goroutine per job and build a fixed-size worker pool in Go with bounded channels, context cancellation, and predictable memory usage.
Compare sync.Mutex, sync.RWMutex, and sync/atomic on real read-heavy and write-heavy Go benchmarks, and see when RWMutex slows down under contention.
Cut per-request allocations with sync.Pool without leaking stale bytes across requests or holding onto oversized buffers forever.
Capture CPU and heap profiles from a Go test or net/http/pprof endpoint, read flat vs cum in go tool pprof -top, and verify that a fix actually reduced allocations.
Detect leaked goroutines and deadlocked channels in Go tests using runtime.NumGoroutine, t.Cleanup, and go test -timeout instead of waiting for a 10-minute CI hang.
Build a Go retry helper that only retries 429 and 5xx errors, adds full jitter to avoid thundering herds, and respects context.Context cancellation between attempts.
Keep one handler panic or one oversized JSON payload from crashing a Go API server using recover middleware and http.MaxBytesReader.
Package a static Go binary in a FROM scratch Docker image with CA certificates for outbound HTTPS calls and a non-root numeric UID so the container runs safely in production.
Learn how &x and *p work in Go, why value parameters copy data, and how to guard against nil pointer dereferences. After this, pointer bugs stop being guesswork.
Structure a multi-package Go repository with cmd/, internal/, go get, and go mod tidy. After this, private packages cannot be imported from outside your module.
Build testable Go CLIs using flag.NewFlagSet, os.Getenv defaults, os.Stderr error messages, and clean integer exit codes.