uber-go/dig

Allow dig.As with dig.Group

Terminator637 opened this issue · 2 comments

Hello there!

Why I can't use dig.As with dig.Group provide option?

It would be better if I can write:

d.Provide(NewCleanService, dig.Group("cron_job"), dig.As(new(cron.Command)))

instead of:

d.Provide(NewCleanService)
d.Provide(func(service *CleanService) cron.Command { return service }, dig.Group("cron_job")))

This is a valid feature request. We'll have someone take a look when they're able, but feel free to contribute a PR.

Thank you! You are the best!