When working with Go in an industrial context, I feel like dependency injection (DI) often
gets a bad rep because of DI frameworks. But DI as a technique is quite useful. It just
tends to get explained with too many OO jargons and triggers PTSD among those who came to Go
to escape GoF theology.Dependency Injection is a 25-dollar term for a 5-cent concept.
— James Shore
DI basically means passing values into a constructor instead of creating them inside it.
That’s really it. Observe:
Read in full here: