@@ -72,23 +72,26 @@ func (m *Matrix) FanOut() []Params {
7272 for _ , parameter := range m .Params {
7373 combinations = combinations .fanOutMatrixParams (parameter )
7474 }
75- combinations = combinations .overwriteCombinations (includeCombinations )
75+ combinations .overwriteCombinations (includeCombinations )
7676 combinations = combinations .addNewCombinations (includeCombinations )
7777 return combinations .toParams ()
7878}
7979
8080// overwriteCombinations replaces any missing include params in the initial
8181// matrix params combinations by overwriting the initial combinations with the
8282// include combinations
83- func (cs Combinations ) overwriteCombinations (ics Combinations ) Combinations {
83+ func (cs Combinations ) overwriteCombinations (ics Combinations ) {
8484 for _ , paramCombination := range cs {
8585 for _ , includeCombination := range ics {
8686 if paramCombination .contains (includeCombination ) {
87- includeCombination .overwrite (paramCombination )
87+ // overwrite the parameter name and value in existing combination
88+ // with the include combination
89+ for name , val := range includeCombination {
90+ paramCombination [name ] = val
91+ }
8892 }
8993 }
9094 }
91- return cs
9295}
9396
9497// addNewCombinations creates a new combination for any include parameter
@@ -115,14 +118,6 @@ func (c Combination) contains(includeCombination Combination) bool {
115118 return true
116119}
117120
118- // overwrite the parameter name and value exists in combination with the include combination
119- func (c Combination ) overwrite (oldCombination Combination ) Combination {
120- for name , val := range c {
121- oldCombination [name ] = val
122- }
123- return oldCombination
124- }
125-
126121// shouldAddNewCombination returns true if the include parameter name exists but the value is
127122// missing from combinations
128123func (cs Combinations ) shouldAddNewCombination (includeCombination map [string ]string ) bool {
0 commit comments