Dependency Injection in Go
Update - you should probably read my more recent
post about
dependency injection with wire.
I recently built a small project in Go. I’ve been working with Java for the past
few years and was immediately struck by the lack of momentum behind Dependency
Injection (DI) in the Go ecosystem. I decided to try building my project using
Uber’s dig library and was very impressed.
I found that DI helped solve a lot of problems I had encountered in my previous
Go applications – overuse of the init function, abuse of globals and
complicated application setup.
blog.drewolson.org