MCPcopy
hub / github.com/kubernetes/kubectl / uniquePathsList

Function uniquePathsList

pkg/cmd/plugin/plugin.go:274–285  ·  view source on GitHub ↗

uniquePathsList deduplicates a given slice of strings without sorting or otherwise altering its order in any way.

(paths []string)

Source from the content-addressed store, hash-verified

272// uniquePathsList deduplicates a given slice of strings without
273// sorting or otherwise altering its order in any way.
274func uniquePathsList(paths []string) []string {
275 seen := map[string]bool{}
276 newPaths := []string{}
277 for _, p := range paths {
278 if seen[p] {
279 continue
280 }
281 seen[p] = true
282 newPaths = append(newPaths, p)
283 }
284 return newPaths
285}
286
287func hasValidPrefix(filepath string, validPrefixes []string) bool {
288 for _, prefix := range validPrefixes {

Callers 1

ListPluginsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…