(valuesSets ...[]VariableValue)
| 252 | } |
| 253 | |
| 254 | func CombineVariableValues(valuesSets ...[]VariableValue) []VariableValue { |
| 255 | combinedValues := make(map[string]string) |
| 256 | |
| 257 | for _, values := range valuesSets { |
| 258 | for _, v := range values { |
| 259 | combinedValues[v.Name] = v.Value |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | var result []VariableValue |
| 264 | for name, value := range combinedValues { |
| 265 | result = append(result, VariableValue{Name: name, Value: value}) |
| 266 | } |
| 267 | |
| 268 | sort.Slice(result, func(i, j int) bool { |
| 269 | return result[i].Name < result[j].Name |
| 270 | }) |
| 271 | return result |
| 272 | } |
no outgoing calls
no test coverage detected