uber-go/fx

Error on invalid lifecycle hooks

sywhang opened this issue · 0 comments

Lifecycle hooks cannot take a dependency on things that the constructor does not have a direct dependency on or produces as a result type.

When a user mistakenly specifies a hook that does this, it will fail with dependency not satisfied error which can be confusing. We should detect this at Provide time and return an error.