-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a dig.As ProvideOption #252
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #252 +/- ##
==========================================
+ Coverage 98.40% 98.47% +0.06%
==========================================
Files 10 10
Lines 1130 1179 +49
==========================================
+ Hits 1112 1161 +49
Misses 13 13
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
I see the following:
|
This brings back #233. Per #235 (review), the issues we need to resolve are, 1. `dig.As` seems to indicate that it's a total override of the provided type. The way it currently works is it appends other interfaces on top of whatever the constructor already returns 2. semantics of `dig.Provide(func New() (Foo, io.Reader, error), dig.As(new(io.Writer)`. It currently fails due to inability to case reader to writer, but we'd want some extra validation here. Perhaps `dig.As` is only supported for a single type, error tuple? Closes #197
Superseded by #293 |
This brings back #233.
Per #235 (review),
the issues we need to resolve are,
dig.As
seems to indicate that it's a total override of the providedtype. The way it currently works is it appends other interfaces on
top of whatever the constructor already returns
dig.Provide(func New() (Foo, io.Reader, error), dig.As(new(io.Writer)
.It currently fails due to inability to case reader to writer, but
we'd want some extra validation here. Perhaps
dig.As
is onlysupported for a single type, error tuple?
Closes #197