Andrew Dodd

 Home

Updating SimpleCQRS Golang port

Overview I found that my Golang port of the SimpleCQRS project had a) a few errors that I really should fix, and b) should probably be refactored to be non-blocking on the command submission (up for debate I guess). While fixing them I discovered a new way to look at eventual consistency (and learned to be ok with it). First, the fix I decided one day to run Go’s race detector on the code from the original port, only to find that there was a data race!

Golang port of Greg Young's SimpleCQRS project

TL;DR I ported Greg Young’s Simple CQRS Example to Go. Check it out here: Golang Version. Why Mainly because I wanted to see if I could implement something very similar in Go. In particular, I wanted to see if I could find a way to implement the functionality of the AggregateRoot abstract class (without using the method overloading that it relies on). Interesting bits The C# example uses subclassing and method overloading to make sure the correct logic is called on the aggregate root objects for both commands and events.