News for hackers. Stuff that matters.
Re:Dependency injection in Go with Uber-go/fx by ferdowsi on Sunday February 27, 2022 @01:44PM (#30491201)
Not just that, but I don't understand why users would be so eager to kill type safety in their applications. If i'm understanding, these injection methods are totally type-unsafe and construction errors are deferred until runtime?

https://pkg.go.dev/go.uber.org/fx#Provide

Re:Dependency injection in Go with Uber-go/fx by dcormier on Sunday February 27, 2022 @06:15PM (#30493842)
I've used this framework. The exceptions being deferred until runtime were really frustrating.

If you really want to use DI in golang, for some reason, wire[1] at least still gives you type safety and compile-time failures.

1. https://github.com/google/wire