MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / dedupAndRemoveFeatures

Function dedupAndRemoveFeatures

features/features.go:71–90  ·  view source on GitHub ↗

Remove any duplicate features from the list and remove deprecated features

(features []string)

Source from the content-addressed store, hash-verified

69
70// Remove any duplicate features from the list and remove deprecated features
71func 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}

Calls

no outgoing calls