Philosophy & Idioms
What Go optimises for, how it does OO without classes, and the idioms that follow.
Notes on Go as a technology: how it thinks, how to write it idiomatically, and how to build, test and ship it.
| Page | What’s in it |
|---|---|
| Philosophy & Idioms | Design goals, OO without classes, idiomatic design |
| Types, Interfaces & Composition | Structs, methods, implicit interfaces, embedding, generics, packages |
| Errors | Errors as values, wrapping, errors.Is/As, defer, panic |
| Concurrency | Goroutines, channels, select, context, shutdown, pitfalls |
| Web Services with the Standard Library | net/http routing, middleware, slog, go:embed, pprof |
| Toolchain: Build, Check, Ship | The go command, cross-compiling, static binaries, containers |
| Testing & Profiling | Table-driven tests, fakes, testcontainers, Playwright, fuzzing, pprof |
| Gotchas | Surprises for newcomers |
| OpenAPI Code Generator | Generating gin server scaffolding from an OpenAPI spec |
What Go optimises for, how it does OO without classes, and the idioms that follow.
Structs, methods, implicit interfaces, embedding and generics.
Errors as values: sentinels, wrapping, errors.Is/As, defer, panic and recover.
Goroutines, channels, select, context, mutexes and common patterns.
net/http routing, middleware, slog, go:embed, config and pprof without a framework.
The go command as build tool, formatter and linter; cross-compiling and container images.
go test, table-driven tests, fakes, httptest, testcontainers, Playwright, benchmarks, fuzzing and pprof.
Things that compile fine in your head but not in Go, or compile and surprise you.
Per-tag gin server scaffolding from an OpenAPI spec using oapi-codegen and a custom splitter.