Book Description
Go simplifies the process of building steadfast and well-organized software. Leverage Dependency Injection and Testings to produce clean, loosely coupled Go code that is inherently easier to read, maintain, test and extend.
Hands-On Dependency Injection and Testing in Go is an in-depth guide to Dependency Injection and the SOLID principles for Go. It will take you on a journey to refactor existing code to adopt Dependency Injection using several methods available in Go. Each method is explained in detail, focusing on their strengths and weakness and with the help of examples, and you will gain knowledge on how to best leverage the method to transform the code into something simple and flexible. Moving ahead, you will learn how to incorporate the dependency graph to spot and eliminate issues. The book will educate you on the techniques involved in using Dependency Injection with test stubs and mocks to test otherwise difficult or impossible scenarios and achieve thorough unit test coverage.
Finally, we will talk about how to design a system from scratch to support Dependency Injection and also Dependency Injection anti-patterns.