We’ve coded a simple Todo API in the last part: Building APIs with Go — Part 2 Writing our first endpoints | by Fernando H. Bandeira | May, 2021 | Medium

Now we’ll add logging, APM, panic recovery, graceful shutdowns, and error handling to our API.

The code of this part is available on Github: fernandobandeira/go-api at part-3 (github.com)

First, let’s start with our logger and telemetry:

Create logger and telemetry agent (main.go)

We are using zerolog as our structured logging package. Another good package for this would be the uber zap package. …


We’ve reviewed some frameworks and routers on the previous part: Building APIs with Go — Part 1 Choosing our router | by Fernando H. Bandeira | Apr, 2021 | Medium

Now that we’ve chosen our router, we can proceed and build our first endpoints for the API.

We will be defining a directory structure and building a simple Todo API. As we advance in the series, we’ll be adding extra features to this API.

The code of this part is available on Github: fernandobandeira/go-api at part-2 (github.com)

First, let’s take a look at some architectural standards:

DDD, Hexagonal, Onion, Clean, CQRS, … How I put it all together — @hgraca (herbertograca.com)

To summarize, the goal…


This post is the start of a series to help you learn and make good decisions about your API in Go.

We’ve been testing different languages, libraries, and coding practices for our product at my current employer. After all of that, we’ve concluded that there’s hardly a language as good as Go to build backend APIs currently. This conclusion applies to our team; you should always consider your decisions with your team in mind.

With that in mind, let’s make it clear that the focus of this series is a good development experience. Still, we don’t want to add unnecessary…

Fernando H. Bandeira

CTO @ Goodworld

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store