My Golang Bookshelf — The Amazing, Good, and not recommended!

Patrick Picard
ITNEXT
Published in
6 min readSep 6, 2022

--

Recently, I was sharing book recommendations on Twitter when discussing Dependency Injection. The thread was a bit tongue in cheek, but it triggered me because I had recently read an excellent book on the subject.

TLDR: Dependency Injection is more than just “passing parameters”.

Putting Twitter aside, I looked at my bookshelf and realized that my Golang collection is becoming impressive and I should share my thoughts. This is a gentle overview and not a deep review of each book. The intent is to set you in the right direction if interested in learning Golang and avoid picking books that are perhaps not worth it.

I provide a quick summary of my bookshelf and recommendations and then go into each individual book in order of preference. I share links for each book (all direct links)

Summary

Summary

Addison Wesley — The Go Programming Language

This is THE book that must be on your bookshelf if you come from other languages. This book focuses on the language itself and its building blocks. In 350 pages, it packs a punch and is dense. The book can be summarized into:

  • Language constructs (data types, composites, functions, methods, structs, interfaces)
  • Concurrency (goroutine, channels, mutexes, race detection)
  • Packaging
  • Testing
  • Misc Features (reflection / low-level programming).

This is the book you will refer back to as the reference. Reference books don’t have to be 700 pages long!

https://www.amazon.ca/Go-Programming-Language-Alan-Donovan/dp/0134190440

Packt — Hands-on Dependency Injection in Go

Not coming from a development background, I have been focusing on improving my coding style as I learn Go and also try to do as much testing as possible. This led me to this book. I was originally reluctant as my experience with Packt books has not been positive. This book definitely changed my perspective (or at least a pleasant surprise / exception).

The book covers an introduction to DI and the SOLID principles. This is the foundation of the book before delving into using DI and various methods to improve your code quality and testability.

The book uses a relatable system as the foundation to showcase the various techniques and builds on past techniques as you progress. Methods include monkey patching, constructor injection, method injection, JIT injection, config injection, and more.

This is another book that I will refer back to. I probably should give it another read in the future to sharpen up and apply more of the concepts.

https://www.amazon.ca/Hands-Dependency-Injection-Corey-Scott/dp/1789132762

Bitfield Consulting — The Power of Go Tools

Jon Arundel, the author, has a series of books on Golang. He’s is self-published and his books are phenomenal. His books are only in digital format (makes me sad). I have skipped reviewing his mini-books to focus on his meaty ones.

The Power of Go Tools takes on a common challenge, developing CLI applications and use that as the foundation to demonstrate many concepts. I found this approach very useful and it felt like going on a journey. The book goes beyond the CLI tool creation and introduces adjacent concepts.

The book covers the creation of a library, standardizing objects with structs and opinionated constructors, then covers accepting inputs from the end user through options (and how to test it!), expanding to the use of Flags and Arguments, how to interact with files and Filesystem abstractions, etc.

I have been able to use a few of the concepts into my own projects. I forked ttlcache and added a new option flag to prevent overwriting cache items. Had I not read the content in this book, I would not have understood how this is done!

What is interesting in the approach is the constant use of tests and how to develop the software to be testable. John provides a challenges along to way to test your skills by expanding the program under development in each chapter.

https://bitfieldconsulting.com/books/tools

Bitfield Consulting — The Power of Go Tests

I am a pre-order customer and the book literally came out today. It is on my todo list and I am sure will be a keeper. I am REALLY excited about this one.

https://bitfieldconsulting.com/books/tests

Bitfield Consulting — Know Go Generics

This is also on my todo list to read. Generics is a hotly anticipate feature recently added to the language.
I have used Generics a little when using the ttlcache project and it is quite powerful (although a bit weird to read the code).

I will need to provide an update when I have read it…There is very little content on Generics so far…so this may be the most comprehensive content about it.

https://bitfieldconsulting.com/books/generics

Manning — Go Web Programming

Golang is quite common as a language for creating APIs and for web purposes. I picked up this book as I wanted to interact with APIs (as a consumer) and work with local MySQL databases. This book was an excellent introduction to most topics you’d run into if building for the web: introduction to HTTP, sample request/response, handlers, responses, cookies & session management, displaying content, interacting with backends (database, cache, files, ORM, and web services). My favorite part was interacting with API’s and parsing the results into structs with the use of struct tags (coming from other languages, I thought this was very cool and powerful).

This book focused on using core libraries such as net. You won’t see all the latest frameworks such as Gorilla, gin. At a minimum, the concepts provide you with a good foundation to evaluate the frameworks for your use.

I enjoyed the book as it provided me with the boost I was looking for rather than scouring the internet.

https://www.manning.com/books/go-web-programming

Packt — Hands-on Software Engineering with Golang

Note: I am still reading this book and my opinion may change.

So far, this book is middle of the road for Packt. It is well written and the content flows nicely. This book spent efforts on covering tooling around golang (ie tools that help you in the development lifecycle) which is undercovered area.

The book covers a sample application that will be built over multiple chapter to introduce the process of engineering the solution from start to finish. This is a useful method and also showcases an application that is significantly more complex than just hello world. The application is scaled as it evolves through the chapters.

So far, I recommend it and I’m looking forward to

  • Chapter 10 — Packaging / deploying the application
  • Chapter 11 — decomposing the app into microservices
  • Chapter 13 — instrumenting the code for running in a kubernetes environment

https://www.amazon.ca/Hands-Software-Engineering-Golang-programming/dp/1838554491

Packt — Hands-on Software Architecture with Golang

This book falls under my “reluctance” against Packt books. It takes a dictionary approach to covering everything and nothing at the same time. It covers so many topics with very little depth.

It also lacked on the Golang front. This felt more like a software architecture book with a sprinkle of go. The book was also shock full of mistakes and typos; no editing. Not recommended

https://www.amazon.ca/Hands-Software-Architecture-Golang-applications/dp/1788622596

Manning — Go in Action

This was the first Go book I purchased when I got started. I bought it because of my past experience with Manning (their books are awesome).

The book starts with an example application rather than the basics. I found myself reading a 2 page code snippet and then broken down over 10–15 pages (and repeated many times).

Overall, I hated the flow from this book. To learn the language basics, refer to The Go Programming Language!

I think there are some portions of the books that I’ve referred back to which were successful (goroutines/channels). But overall, I felt let down in comparison to other Manning books. Not recommended.

https://www.manning.com/books/go-in-action

--

--