{"repo":"goioc/di","free":true,"listed":false,"github":"https://github.com/goioc/di","clone":"git clone https://github.com/goioc/di.git","description":"Simple and yet powerful Dependency Injection for Go","language":"Go","stars":378,"topics":["dependency-injection","go","golang","golang-library","inversion-of-control"],"license":"MIT","category":"dev-tools","readme_excerpt":"goioc/di: Dependency Injection Why DI in Go? Why IoC at all? I've been using Dependency Injection in Java for nearly 10 years via Spring Framework. I'm not saying that one can't live without it, but it's proven to be very useful for large enterprise-level applications. You may argue that Go follows a completely different ideology, values different principles and paradigms than Java, and DI is not needed in this better world. And I can even partly agree with that. And yet I decided to create this light-weight Spring-like library for Go. You are free to not use it, after all 🙂 Is it the only DI library for Go? No, of course not. There's a bunch of libraries around which serve a similar purpose (I even took inspiration from some of them). The problem is that I was missing something in all of these libraries... Therefore I decided to create Yet Another IoC Container that would rule them all. You are more than welcome to use any other library, for example this nice project. And still, I'd recommend stopping by here 😉 So, how does it work? It's better to show than to describe. Take a look at this toy-example (error-handling is omitted to minimize code snippets): services/weather service.go controllers/weather controller.go init.go main.go If you run it, you should be able to observe a neat weather forecast at http://localhost:8080/weather?city=London (or for any other city). Of course, for such a simple example it may look like an overkill. But for larger projects with many inter","default_branch":null,"files":null,"tree":[],"storefront":"/r/goioc","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/goioc/di/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}