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

feat: add a ProvideOptions method for di initialization (solve #51) #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matdurand
Copy link
Contributor

@matdurand matdurand commented Dec 16, 2023

ProvideOptions is used to have a method receive dependencies and return other dependencies to be registered. This is useful to do conditional factories that return a variable number of dependencies.

Once I get confirmation that the code looks good, I will add the tests and doc.

Another option would be to simplify by not using a separate method, but by changing the Provide method to handle the special case of a constructor returning di.Option or []di.Option.

ProvideOptions is used to have a method receive dependencies and return
other dependencies to be registered. This is useful to do conditional
factories that return a variable number of dependencies.
Copy link

codecov bot commented Dec 16, 2023

Codecov Report

Attention: 69 lines in your changes are missing coverage. Please review.

Comparison is base (0739076) 95.27% compared to head (60bd3bb) 88.41%.
Report is 2 commits behind head on master.

Files Patch % Lines
container.go 0.00% 46 Missing and 1 partial ⚠️
factory.go 0.00% 13 Missing ⚠️
options.go 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
- Coverage   95.27%   88.41%   -6.87%     
==========================================
  Files          16       17       +1     
  Lines         889      958      +69     
==========================================
  Hits          847      847              
- Misses         30       98      +68     
- Partials       12       13       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ghost
Copy link

ghost commented Dec 16, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@matdurand matdurand changed the title feat: add a ProvideOptions method for di initialization feat: add a ProvideOptions method for di initialization (solve #51) Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant