After seeing several posts on the /r/golang subreddit, e.g. this one, sing this book’s praises, I decided I better give it read.

It also has pretty solid reviews on good reads.

There are so many ways to do things in programming, that I admit I found the catchy title engaging - I definitely want to know what I should not be doing! It turns out, there was a lot of things I’ve done in the past that have not been ideal. I found the book so inspiring that I actually created a slide deck for it and gave a presentation at work for the top ten Go Mistakes I’ve run into. I cherry-picked 10 because fitting all 100 into a 30-minute lunch and learn was a bit too daunting a task for me!

If you peruse the slide deck, you’ll notice that the last issue related to “Go Routines and Loop Variables” has been fixed as of Go 1.22. If I had to pick another Go problem to take its place for the top ten, I think I’d have to go with the general mistake of declaring an interface on the producer side. One way I think of it is this - if I’m using an api with 100 exported functions and my code only uses 2 of them, then my code will be easier to maintain and understand if I create an interface with just the 2 functions I need.

Overall, I really enjoyed this book and format of learning by pointing out mistakes. I definitely recommend giving it a read if you’re serious about writing Go code!

Resources