Go
Notes on the Go programming language — interfaces, concurrency, testing, and patterns that have held up in production.
- go
Supervised fire-and-forget in Go
A bounded worker pool for small background tasks, with task-owned contexts, panic recovery, and graceful shutdown.
- go
Modernizers & go fix
Go 1.26 rebuilt go fix on the analysis framework. It modernizes your code and respects the Go version your module declares. The post covers the modernizers, the bigger x/tools suite, and what //go:fix inline can and can't migrate.
- go
Peeking into Go struct tags
A quick tour of Go struct tags: how different libraries use them, how you read them at runtime with reflection, and how other tools read them at build time instead.
- go
What canceled my Go context?
How Go 1.20's WithCancelCause and Go 1.21's WithTimeoutCause let you attach a reason to context cancellation, plus a gotcha with manual cancel and the stdlib pattern that covers every path.
- go
Revisiting interface segregation in Go
Apply SOLID's Interface Segregation Principle in Go with consumer-defined contracts. Learn why small interfaces and implicit implementation matter.
- go
Let the domain guide your application structure
Organize Go apps by domain, not technology. Learn why models/controllers structure hurts and how bounded contexts create better separation.
- go
Early return and goroutine leak
Prevent goroutine leaks caused by early returns with unbuffered channels. Learn buffering, draining, errgroup patterns, and goleak testing.
- go
Gateway pattern for external service calls
Separate business logic from external service calls using the Gateway pattern. Apply dependency inversion and interface segregation in Go.
- go
Why does Go's io.Reader have such a weird signature?
Understand why io.Reader takes a byte slice parameter instead of returning one. Learn about heap allocations and buffer reuse in Go streams.
- go
Writing a circuit breaker in Go
Build a production-ready circuit breaker in Go from scratch with closed, open, and half-open states to prevent cascading failures.