Writing distributed services in Go is made easier through the use of go-kit. If you haven’t already used go-kit, I definitely recommend checking it out. You can learn most of the basics by working through this example. For this post, you basically need to understand that go-kit offers the ability to break up the construction of services into 3 main layers: transport, endpoint, and service. These layers provide the ability to easily wrap implementations using the middleware or decorator pattern.