Skip to content

Course

Go for Production Services

Go as it earns its keep on a real service: package layout, error discipline, goroutines that don't leak, net/http with actual timeouts, context, table-driven tests, and pprof when things get slow.

9 lessons

Course Q&A

Layout, Errors, and Context: the Plumbing

Project structure that scales, error handling that survives 3am, and context for cancellation and deadlines.

  1. 01A Go Project Layout That Scales Past main.goWhere code goes when a service outgrows one file: cmd/, internal/, and why Go's compiler enforces your boundaries.20mOpen
  2. 02Error Handling Discipline: Wrap, Check, Return OnceSentinel errors, %w wrapping, errors.Is/As, and the one rule that stops double-logged, context-free failures.25mOpen
  3. 03Context: Cancellation, Deadlines, and Request ScopeHow ctx flows through a request, why every WithTimeout needs its cancel, and what context.Value is actually for.25mMembers

Concurrency and HTTP in Anger

Goroutines and channels without leaks, a hardened net/http server, and graceful shutdown with sane config.

  1. 01Goroutines and Channels Without the LeaksEvery goroutine needs an owner and an exit path — the send-blocked leak, errgroup fan-out, and bounded worker pools.30mMembers
  2. 02net/http Services: Handlers, Middleware, and Real Timeoutshttp.ListenAndServe ships with zero timeouts. Build an http.Server deliberately, and never trust the default http.Client.30mMembers
  3. 03Graceful Shutdown and Boring, Correct Configsignal.NotifyContext, srv.Shutdown, draining workers, env-based config, and health endpoints that tell the truth.25mMembers

Test It, Profile It, Run It

Table-driven tests and httptest, pprof on a live service, then logging, metrics, and shipping safely.

  1. 01Table-Driven Tests and httptest: Go's Testing IdiomsOne test function, a table of cases, real HTTP round-trips with httptest.NewServer — and -race in CI, always.30mPremium
  2. 02Profiling a Live Service with pprofCPU, heap, and goroutine profiles from a running process — plus why /debug/pprof must never face the internet.35mPremium
  3. 03Running It: Structured Logs, Metrics, and Ship-Safe Buildsslog for logs you can query, RED metrics that don't explode cardinality, govulncheck, and container-aware builds.30mPremium