@@ -72,23 +72,26 @@ func (m *Matrix) FanOut() []Params {
72
72
for _ , parameter := range m .Params {
73
73
combinations = combinations .fanOutMatrixParams (parameter )
74
74
}
75
- combinations = combinations .overwriteCombinations (includeCombinations )
75
+ combinations .overwriteCombinations (includeCombinations )
76
76
combinations = combinations .addNewCombinations (includeCombinations )
77
77
return combinations .toParams ()
78
78
}
79
79
80
80
// overwriteCombinations replaces any missing include params in the initial
81
81
// matrix params combinations by overwriting the initial combinations with the
82
82
// include combinations
83
- func (cs Combinations ) overwriteCombinations (ics Combinations ) Combinations {
83
+ func (cs Combinations ) overwriteCombinations (ics Combinations ) {
84
84
for _ , paramCombination := range cs {
85
85
for _ , includeCombination := range ics {
86
86
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
+ }
88
92
}
89
93
}
90
94
}
91
- return cs
92
95
}
93
96
94
97
// addNewCombinations creates a new combination for any include parameter
@@ -115,14 +118,6 @@ func (c Combination) contains(includeCombination Combination) bool {
115
118
return true
116
119
}
117
120
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
-
126
121
// shouldAddNewCombination returns true if the include parameter name exists but the value is
127
122
// missing from combinations
128
123
func (cs Combinations ) shouldAddNewCombination (includeCombination map [string ]string ) bool {
0 commit comments