Welcome to Go in Practice
This course is opinionated. It reflects how I build production Go services. You might disagree, and that's fine.
Three rules before we start:
- Use Go standard libraries and avoid external packages unless you have to
- Don't forget rule number 1
- You've learned Go and concurrency patterns? Good for you, but that doesn't mean you should use them everywhere. Go's philosophy is minimal and simple. Only use something when it's suitable and necessary.
What We're Building
A bookmarks API — a REST service for saving, organizing, and retrieving links. We'll build it from scratch, adding one capability per lesson. By the end, you'll have a production-ready Go project with proper structure, logging, error handling, database access, tests, and deployment.
No frameworks. No ORMs. No magic. Just Go and its standard library.
What You'll Learn
- Project structure: how to organize a Go project without over-engineering
- Configuration:
os.Getenvand flags, no Viper needed - slog: structured logging built into Go
- net/http: routing with Go 1.22+, no Gin/Chi/Gorilla needed
- Middleware: the
func(http.Handler) http.Handlerpattern - Error handling: wrapping, tracing, sentinel errors
- Multi-module:
go workfor shared packages across modules - database/sql: SQL with lib/pq, why you might not need an ORM
- HTTP client: proper timeouts, retries, context cancellation
- Testing: table-driven tests,
httptest, test helpers - Templates:
html/templatefor server-rendered pages - Embedding:
//go:embedfor bundling files into a single binary - Graceful shutdown:
os/signal+contextfor clean stops - Profiling:
pprof, benchmarks, "profile first, don't guess" - Deployment: Makefile, Dockerfile, docker-compose
Prerequisites
Complete Go Essentials or have equivalent knowledge. Familiarity with Go Concurrency Patterns helps — but this course focuses on building real services, not concurrency theory.
Why No Frameworks?
Go 1.22 added method-based routing to net/http. You can now write mux.HandleFunc("GET /users/{id}", handler) without any external router. The standard library covers routing, middleware, templates, JSON, database access, HTTP clients, testing, and profiling. External packages add convenience but also dependencies, upgrade burden, and abstraction layers you don't control.
This course teaches you to build with what Go gives you. Once you understand the stdlib, you can make an informed decision about when a framework actually helps.
Let's build something.