Given that config injection is an expanded form of constructor and method injections, the advantages of the other methods also apply here. In this section, we will discuss only the additional benefits that are specific to this method.
It's excellent for decoupling from a config package—When we have a config package that loads from a single place, such as a file, then this package tends to become a dependency for many of the other packages in the system. When considering the Single responsibility principle section from Chapter 2, SOLID Design Principles for Go, we recognize that the more users a package or object has, the more resistant and/or difficult it is to change.
With config injection, we are also defining our requirements in a local interface and leveraging Go's implicit interfaces and the dependency inversion principle...