Application Focused API Design

“I think it’s ok to do heinous stuff to test an API if it makes it more usable by others.” - Nate Finch Prelude If you are new to Go, it might help to read these posts first before continuing on with this post. https://www.ardanlabs.com/blog/2014/05/methods-interfaces-a...

From Zero to Staging and Back

Deliver my data, Mr. Json!

JSON is the lingua franca of exchanging data over the net and between applications written in different programming languages. In this article, we create a tiny JSON client/server app in Go.

Using contexts to avoid leaking goroutines

The context package makes it possible to manage a chain of calls within the same call path by signaling context’s Done channel. In this article, we will examine how to use the context package to avoid leaking goroutines. Assume, you have a function that starts a goroutine i...

Avoid Interface Pollution

Introduction Interfaces should only be used when their added value is clear. I see too many packages that declare interfaces unnecessarily, sometimes just for the sake of using interfaces. The use of interfaces when they are not necessary is called interface pollution. This is a...

The Myth of the Root Cause: How Complex Web Systems Fail (Scalyr)

The Power of Less Code

Debugging code generation in Go

Last week, I was at dotGo. I gave a very short lightning talk about inspection of code generation with the tools already available in the toolchain. This post goes through the talk for those who didn’t have the privilege to be at the conference. Slides are also available at...

Keeping Go a human-first language

Disclaimer: I forked my opinions on this one from a barely readable Twitter thread and wanted to write it down how I feel about keeping the language internals away from the users, especially from the newcomers. This is not a skill-level concern, it is a core goal of Go to provide...

A Random Blog Post

How to generate random numbers, and the difference between math/rand and crypto/rand.