Skip to content

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

Open
matdurand wants to merge 1 commit into
d3fvxl:masterfrom
matdurand:feat/options-provider
Open

feat: add a ProvideOptions method for di initialization (solve #51)#53
matdurand wants to merge 1 commit into
d3fvxl:masterfrom
matdurand:feat/options-provider

Conversation

@matdurand

@matdurand matdurand commented Dec 16, 2023

Copy link
Copy Markdown
Contributor

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.
@codecov

codecov Bot commented Dec 16, 2023

Copy link
Copy Markdown

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

ghost commented Dec 16, 2023

Copy link
Copy Markdown
👇 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.

1 participant