Skip to content

Course

Go Web Services

A production-minded path through Go HTTP services — stdlib-first design, middleware, shutdown discipline, pooling, testing, and deployment operations.

9 lessons

Course Q&A

Reviews

Enrolled members can rate this course.

No reviews yet.

Production HTTP Foundations

Build services around net/http, explicit routing, disciplined validation, useful errors, and middleware that carries its weight.

  1. 01Start with net/http, Not a Framework-shaped HoleDesign the small server core first: explicit construction, clean handler interfaces, configuration boundaries, and honest ownership of dependencies.22mOpen
  2. 02Routing, Validation, and Errors That Help Instead of LeakMake request contracts explicit, validate at the boundary, and shape errors so clients get useful answers without internal details escaping.24mOpen
  3. 03Middleware Is a Cost Center: Make It Earn Its KeepCompose request logging, auth, recovery, headers, and request identity without creating hidden control flow or ordering bugs.26mOpen

Reliability and Runtime Behavior

Control deadlines, cancellation, graceful shutdown, and outbound connection pooling before production controls them for you.

  1. 01Timeouts, Contexts, and the Discipline of Giving UpSet server, client, and dependency deadlines deliberately so slow work cannot consume every goroutine, socket, and database connection.27mOpen
  2. 02Graceful Shutdown: Stop Taking Work Before You Drop ItHandle signals, stop listeners, drain in-flight requests, close resources in order, and avoid the false confidence of a single shutdown timeout.25mOpen
  3. 03Outbound HTTP and Connection Pooling Are Production CodeConfigure http.Client, transports, retries, and pool limits deliberately so downstream dependencies cannot exhaust your service from the inside.28mOpen

Testing, Observability, and Deployment

Use httptest, operational signals, profiling, and deployment hygiene to make services testable, debuggable, and safe to operate.

  1. 01Test HTTP Services with httptest Before You Need a BrowserUse httptest.ResponseRecorder, httptest.Server, table tests, and realistic dependency seams to verify behavior at the transport boundary.23mOpen
  2. 02Logs, Metrics, and pprof: Seeing the Service You Actually RunEmit structured logs, low-cardinality metrics, health signals, and controlled profiling endpoints that explain behavior during incidents.26mOpen
  3. 03Deployment Hygiene: Small Binaries, Predictable Rollouts, Honest RollbacksBuild reproducible static binaries, configure processes deliberately, roll out with health gates, and prepare rollback paths that account for data changes.29mOpen