dig
dig copied to clipboard
Add CanInvoke for easy validation
I would like to be able to write a unit test that validates that the set of dig providers is correct to invoke a particular function. Since some providers are RPC clients and DB clients which are required by other injected types, it's impossible to do this without making it an integration test, which feels unnecessarily brittle.
How do you feel about providing a method that just checks the needed items are provided to Invoke something, returning the error that would have been returned otherwise?
Hi! I'm so sorry for the long delay here - I didn't realize that I wasn't subscribed to this repo. (And thanks for writing Revel!)
I'm definitely open to this. If you don't have the bandwidth to open a PR, I'll keep it in our backlog.
If you haven't, take a look at fx
(github.com/uber-go/fx) too - it's the service framework that we built around this package.