samber / do

⚙️ A dependency injection toolkit based on Go 1.18+ Generics.
https://pkg.go.dev/github.com/samber/do
MIT License
1.71k stars 67 forks source link

Is there an equivalent to dig.As() ? #41

Closed varunbpatil closed 7 months ago

varunbpatil commented 10 months ago

I have a constructor that returns a concrete type which implements more than one interface and I would like to register the same instance as providing multiple interfaces.

In dig, it is possible using dig.As().

samber commented 8 months ago

it will be added in do@v2 -> #45