(results map[string]PluginRunResult, order []string)
| 401 | } |
| 402 | |
| 403 | func normalizeRunPluginOrder(results map[string]PluginRunResult, order []string) []string { |
| 404 | seen := map[string]struct{}{} |
| 405 | names := make([]string, 0, len(results)) |
| 406 | for _, name := range order { |
| 407 | if _, ok := results[name]; !ok { |
| 408 | continue |
| 409 | } |
| 410 | if _, ok := seen[name]; ok { |
| 411 | continue |
| 412 | } |
| 413 | seen[name] = struct{}{} |
| 414 | names = append(names, name) |
| 415 | } |
| 416 | for _, name := range sortedRunPluginNames(results) { |
| 417 | if _, ok := seen[name]; ok { |
| 418 | continue |
| 419 | } |
| 420 | names = append(names, name) |
| 421 | } |
| 422 | return names |
| 423 | } |
| 424 | |
| 425 | func sortedMetricNames(metrics map[string]any) []string { |
| 426 | names := make([]string, 0, len(metrics)) |
no test coverage detected