-
Notifications
You must be signed in to change notification settings - Fork 152
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
added simple dependency provider #16
Conversation
stephanos
commented
Mar 2, 2014
- values can be created by factory
- factory is a simple function
- factory results are cached
- factory can depend on other factory
- dependency loop detection (plus detailed error description)
- values can be created by factory - factory is a simple function - factory results are cached - factory can depend on other factory - dependency loop detection (plus detailed error description)
Initial implementation for issue #10. |
@@ -49,10 +49,11 @@ type TypeMapper interface { | |||
Set(reflect.Type, reflect.Value) TypeMapper | |||
// Returns the Value that is mapped to the current type. Returns a zeroed Value if | |||
// the Type has not been mapped. | |||
Get(reflect.Type) reflect.Value | |||
Get(reflect.Type, ...bool) reflect.Value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make more sense to have another method instead of passing a bool to the Get
function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, off the top of my head: yes, it might. Maybe GetRoot(reflect.Type) reflect.Value
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this a subtle hint for me to make this change? I can't handle subtle ;)
I'm going to sit on this for a bit. I'm not super sure about the implementation and I may need to dive into the code a bit more and get a feel for it |
Sure. That's what it's there for: getting the ball rollin' :) If you tell me your worries we could discuss it. |
@codegangsta I'll be working on it again this weekend. If you shared your concerns with the implementation I could improve it ... |
@codegangsta it seems you aren't really interested in working this out. So closing it now. If you change your mind, my fork can be found here: https://github.com/101loops/inject |
Apologies for the lack of response. We may revisit this in a later version but it adds a little too much complexity at the moment. Sent from my iPhone
|