Skip to content
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

Support variadic arguments in factories #1

Open
J7mbo opened this issue Apr 20, 2019 · 0 comments
Open

Support variadic arguments in factories #1

J7mbo opened this issue Apr 20, 2019 · 0 comments
Labels
good first issue Good for newcomers
Milestone

Comments

@J7mbo
Copy link
Owner

J7mbo commented Apr 20, 2019

Given a factory such as:

func NewX(ys ...Y), goij tries to inject a single Y.

The Reflect package does have an IsVariadic() function in there somewhere and this can be used to detect a variadic argument.

The next step would be:

  • If the type is just a struct, inject a single instance of that struct
  • If the type is an interface, to find all types in the type registry that implement that interface and inject them, taking into account whether or not they are already delegated, cached, have their own factories etc.
@J7mbo J7mbo added the good first issue Good for newcomers label Apr 20, 2019
@J7mbo J7mbo added this to the v1.1.0 milestone Apr 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant