Remove any duplicate features from the list and remove deprecated features
(features []string)
| 69 | |
| 70 | // Remove any duplicate features from the list and remove deprecated features |
| 71 | func dedupAndRemoveFeatures(features []string) []string { |
| 72 | // Convert the slice into a set |
| 73 | set := map[string]bool{} |
| 74 | for _, feature := range features { |
| 75 | // Remove deprecated features from the provided list |
| 76 | if slices.Contains(deprecatedFeatures, feature) { |
| 77 | continue |
| 78 | } |
| 79 | set[feature] = true |
| 80 | } |
| 81 | |
| 82 | // Convert the set back into a slice |
| 83 | keys := make([]string, len(set)) |
| 84 | i := 0 |
| 85 | for str := range set { |
| 86 | keys[i] = str |
| 87 | i++ |
| 88 | } |
| 89 | return keys |
| 90 | } |
no outgoing calls