Source: juststeveking.uk

My First Go Module - go api problem
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"` }
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners