-
Notifications
You must be signed in to change notification settings - Fork 1
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
Allow Inject-Tags if types using them are referenced in a Provider-Function #2
base: main
Are you sure you want to change the base?
Conversation
…than an inject-funtion cleanup cleanup
Works in the test file but somehow not when running on the whole project added testfile POC: provider binding test Done documentation removed todo changed error description to match provider errors too cleanup
faa854f
to
417475e
Compare
) | ||
|
||
// helper analyzer which returns all function declarations | ||
var ConfigureDeclAnalyzer = &analysis.Analyzer{ |
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.
Not so happy that this is listed within the checks then. But for now it ts ok i think.
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.
Hm probably move it to analyzers/dingo
? I think it should stay somewhere below dingo
though
|
||
func (d *D) Configure(injector *dingo.Injector) bool { | ||
injector.Bind(new(interface{})).ToProvider(providerFunc) | ||
injector.BindMulti(new(interface{})).ToProvider(d.providerFuncWithSelector) |
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.
Let's also add a BindMap
here for completeness.
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.
What about split declarations like
bind := injector.Bind(new(interface{}))
bind.ToProvider(providerFunc)
?
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.
That's a good point and something we doesn't check rn. Same for the binding_implements_interface analyzer, would be something I can jump on next
No description provided.