I have been playing with GoLang on and off now for around 3 years, but never really had chance to use it the way I wanted to. However, recently with a new client we needed to start building high throughput microservices for their distributed warehouse system.
One thing that was obviously clear, was that we would need to find a nice way to handle, track and explain errors that may occur in the system. In PHP I typically use a fantastic package called https://github.com/Crell/ApiProblem which is RFC compliant and handles errors very nicely.
type APIProblem struct { Title string `json:"title,omitempty"` Detail string `json:"detail,omitempty"` Status string `json:"status,omitempty"` Code string `json:"code,omitempty"` Meta *map[string]interface{} `json:"meta,omitempty"` }