The core of dependency injection, the reason we do it at all, is to make a static map of service objects.
While this is nice, it's really not the core of dependency injection. The reason why you want to do dependency injection at all is:
Take a look at
especially at the end.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
While this is nice, it's really not the core of dependency injection. The reason why you want to do dependency injection at all is:
Take a look at
Learn Go by writing tests: Dependency Injection
Chris James ・ Apr 4 '18 ・ 6 min read
especially at the end.