3 ms·
Interesting that they built a new dependency injection framework, much like similar things in Java. I guess this doesn't replace Context, though? https://githu
by skybrian 8y ago
Interesting that they built a new dependency injection framework, much like similar things in Java. I guess this doesn't replace Context, though?
https://github.com/google/go-cloud/tree/master/wire https://github.com/google/go-cloud/tree/master/wire
- enjoylife 8y agoDoesn't replace context, and neither is it alone in terms of being a DI library, [1]. [1] https://github.com/uber-go/fx https://github.com/uber-go/fx
- latchkey 8y agoAs a Java engineer, I really missed DI in golang. Then I found fx. Once I wrapped my brain around fx, I really liked it and used it heavily in a project I wrote. It was especially good for initializing 'things' of the same 'type'. Like a bunch of controllers for a web app. One nice thing about fx is that it does not rely on code generation (uses reflection instead). I'm very curious what other features wire has over fx.
- gant 8y agoOh no, not another code generator. That seems to be a common thing in Kubernetes too, if you don't want to spend the time writing actual code and Go is too "boilerplate heavy" for you, just write a code generator and bring the complexity of other languages right back!