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.
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.
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.