(raw []string)
| 74 | } |
| 75 | |
| 76 | func normalizeExecutorFormats(raw []string) []sdktranslator.Format { |
| 77 | if len(raw) == 0 { |
| 78 | return nil |
| 79 | } |
| 80 | out := make([]sdktranslator.Format, 0, len(raw)) |
| 81 | seen := make(map[string]struct{}, len(raw)) |
| 82 | for _, item := range raw { |
| 83 | format := normalizeExecutorFormatName(item) |
| 84 | if format == "" { |
| 85 | continue |
| 86 | } |
| 87 | key := format.String() |
| 88 | if _, exists := seen[key]; exists { |
| 89 | continue |
| 90 | } |
| 91 | seen[key] = struct{}{} |
| 92 | out = append(out, format) |
| 93 | } |
| 94 | return out |
| 95 | } |
| 96 | |
| 97 | func normalizeExecutorFormatName(raw string) sdktranslator.Format { |
| 98 | switch strings.ToLower(strings.TrimSpace(raw)) { |
no test coverage detected