Go Tutorials
Standalone Go tutorials covering concrete runtime traps and service patterns: slice backing-array aliasing, nil-map panics, typed-nil interfaces, context.Context timeouts, worker pools, go test -race data races, pprof allocations, and static binaries under 10 MB.
Each guide pairs a small runnable Go program with its exact compiler, test, or benchmark output so you can verify the behavior locally.
Trigger a real data race under go test -race, read the race detector output, and fix shared counters, maps, and slice writes using atomic, sync.Mutex, and disjoint indices.
Measure nanoseconds and heap allocations with testing.B and -benchmem, compare += vs strings.Builder, pre-size slices, and reuse buffers with sync.Pool.
Bundle static files with //go:embed and embed.FS, serve subdirectories cleanly with fs.Sub, and inject version strings with -ldflags -X or debug.ReadBuildInfo.
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.
Write FuzzX(f *testing.F) targets and run go test -fuzz to discover edge-case panics and automatically save regression cases under testdata/fuzz.