February 3, 2018

Event Sourcing in Go: the Event Handler

Recently, I have been working on an event-sourced application built around Command-Query Responsibility Segregation (CQRS). My job was to figure out how to implement a new command in Go. In order to act on a given object, we have to build the current state of that object out of the events that created and modified it. Here I want to show how I have come up with the applier interface to represent the Event logic. Read more
#Go | #TDD

January 28, 2018

A pattern for Go tests

I used to spend an unreasonable amount of time thinking about how to begin writing a test. I googled test patterns in Go. Many people seem to rely on external dependencies for assertions. And in fact, I understand that generic (aha!) functions like isNil(v interface{}) bool can initially bring speed to the development. But in the long run, I think that embracing the true strongly-typed nature of Go, instead of just searching for a way around it, is more rewarding. Read more