Closed abhinav closed 2 years ago
Merging #312 (97eae89) into master (08ad091) will decrease coverage by
0.07%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #312 +/- ##
==========================================
- Coverage 98.61% 98.54% -0.08%
==========================================
Files 19 19
Lines 1230 1233 +3
==========================================
+ Hits 1213 1215 +2
- Misses 10 11 +1
Partials 7 7
Impacted Files | Coverage Δ | |
---|---|---|
constructor.go | 100.00% <100.00%> (ø) |
|
param.go | 98.51% <100.00%> (-0.49%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 08ad091...97eae89. Read the comment docs.
This significantly changes how we instantiate dependencies for a constructor and adds support for value groups.
Previously, for each parameter of a constructor, we attempted to instantiate the value in every scope until one succeeded without dependency errors. Effectively:
This made the behavior less certain because we were relying on fuzzily matching errors.
With this change, we search the container for constructors as needed for singular parameters (paramSingle) and for value groups (paramGroupedSlice). Roughly:
This is cleaner because it works by searching the container for what it needs rather than trying and letting it fail.
This includes a subtle change to constructorNode.Call: previously, when a constructor ran, its results were stored in the containerStore that it used to instantiate its dependencies. Now, results are stored in the containerStore (Scope) to which that constructor was provided. This works because the leaf param types (paramSingle and paramGroupedSlice) will search the scope tree to find the value.