Go has burned me more than once. With bugs that felt like the language was glitching:

Channels that blocked after I’d “fixed” the blocking. Functions that kept running after hitting an error. Slices that printed data that seemingly came out of nowhere.

But as I’ve come to learn, every single time, Go was doing exactly what I asked. I just didn’t fully understand what I was asking for.

So in this article I want to share some of the “gotchas” that have cost me an embarrassing amount of time, simply because I didn’t fully understand how the language and its idioms worked.

I hope they save you some hours of pain.