Recent writings

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.

Test state, not interactions

Avoid brittle AI-generated tests that check implementation details. Write maintainable tests that verify behavior, not method calls.

Early return and goroutine leak

Prevent goroutine leaks caused by early returns with unbuffered channels. Learn buffering, draining, errgroup patterns, and goleak testing.

Lifecycle management in Go tests

Master Go test lifecycle with t.Cleanup(), subtests, and TestMain. Learn per-test, grouped, and package-wide setup patterns effectively.

You probably don't need a DI framework

Dependency injection in Go doesn't need Dig or Wire. Learn why manual wiring beats reflection magic and how Go's design makes DI frameworks overkill.

Go 1.24's "tool" directive

Pin tool versions in Go 1.24 with the new 'tool' directive. Replace tools.go pattern with native go.mod support for project tooling.