Creating Middleware with httprouter

Learn how to use the httprouter Go mux to route your custom handlers HTTP requests and create common functions for all handlers, even those pesky ones like PProf....

 · 8 min · Benjamin Cane

Using Viper With Consul to Configure Go Applications

Viper is a powerful configuration library which also supports pulling configuration from Consul. However, using Consul is not straightforward. This article explains how to use Viper with Consul...

 · 11 min · Benjamin Cane

Golang's Interfaces explained with Mocks

This article covers Go interfaces’ basics and how you can use them to create modular and testable code....

 · 7 min · Benjamin Cane

How to Structure a Go Command-Line Project

Best practices around structuring Go command-line applications where packages go, parse command-line arguments, and optimize for testing....

 · 9 min · Benjamin Cane

Golang working with JSON: Maps vs. Structs

This article covers how to use maps and structs to parse JSON, which is better and safer. It also covers how to work with maps safely....

 · 9 min · Benjamin Cane