Redowan's Reflections — Page 3

Recent writing

Longer articles, short notes, and things I'll probably need to look up again.

Browse the archive
Wrapping a gRPC client in Go

How to wrap a generated gRPC client behind a clean Go API so users never have to touch protobuf types or connection management directly.

Go errors: to wrap or not to wrap?

Exploring the tradeoffs between wrapping errors at every return site versus wrapping only at boundaries, with no definitive answer - just honest tradeoffs for the kind of software I write.

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.

Structured concurrency & Go

How Python and Kotlin provide structured concurrency out of the box while Go achieves the same patterns explicitly using errgroup, WaitGroup, and context.

Splintered failure modes in Go

Simplify Go error handling by consolidating validation and system errors. Learn when to return boolean vs error for clearer failure modes.

Re-exec testing Go subprocesses

Test Go subprocesses with the re-exec pattern: spawn your test binary as a subprocess to emulate real command behavior reliably.

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.

Organizing Go tests

Organize Go tests with in-package, external _test packages, and integration tests. Learn white-box vs black-box testing conventions.

Subtest grouping in Go

Organize Go subtests with t.Run nesting and parallel execution. Learn patterns for setup, teardown, and readable test hierarchies.

Search and navigate

Navigate