Off-the-Shelf Injection
For our final chapter in this section, we are looking at dependency injection (DI) using a framework. Choosing a DI framework that matches your preferred style can make your life significantly easier. Even if you prefer not to use a framework, examining how it is implemented and the approach it takes can be informative and help you find improvements for your preferred implementation.
While there are many frameworks available to us, including Facebook's Inject (https://github.com/facebookgo/inject) and Uber's Dig (https://godoc.org/go.uber.org/dig), for our sample service we are going to use Google's Go Cloud Wire (https://github.com/google/go-cloud/tree/master/wire).
The following topics will be covered in this chapter: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access