Redowan's Reflections
Redowan's Reflections
Redowan
Redowan Delowar's reflections on software, systems, and sundry.
Latest Posts
Go quirks: function closures capturing mutable references
A Go closure holds a live reference to whatever it captures, not a snapshot. Real examples of where this trips people up, and how to keep it boring.
Accepted proposal: UUID in the Go standard library
Notes on Go's newly accepted uuid proposal and the tradeoffs behind the API.
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.
UUIDs are coming to the Go stdlib
Go's proposal review group accepted a new uuid package with v4 and v7 generators. Here are the decisions that shaped the final API.
Error translation in Go services
Translating errors at layer boundaries so storage details don't leak into the handler or, worse, into client responses.
Stacked log lines considered harmful
Why logging at every layer of a service produces noise, and how to log only at the handler level while propagating context from below.
What's the ideal dispatch mechanism?
Switch, map of functions, and interface registry for dispatching in Go.
Background jobs and inherited file descriptors
Why & backgrounds execution but doesn't stop output from flooding your terminal.
Testing unary gRPC services in Go
How to test unary gRPC services in Go - handler logic, interceptors, deadlines, metadata propagation, and rich error details - all in-memory with bufconn.
Repositories, transactions, and unit of work in Go
Decoupling business logic from storage in Go, adding transaction support without leaking SQL details, and coordinating atomic writes across multiple repositories using a unit of...
How do you handle transactions with the repository pattern?
Adding transaction support to a repository interface without leaking storage details.
Is passing user ID through context an antipattern?
Why the middleware-to-handler boundary is a special case for context values.
Do you need a repository layer on top of sqlc?
Decoupling business logic from storage with a small interface in Go.