MCPcopy Index your code
hub / github.com/cloudfoundry/cli / StringSlice

Function StringSlice

util/unique/string_slice.go:3–13  ·  view source on GitHub ↗
(input []string)

Source from the content-addressed store, hash-verified

1package unique
2
3func StringSlice(input []string) []string {
4 result := make([]string, 0, len(input))
5 seen := make(map[string]struct{})
6 for _, v := range input {
7 if _, ok := seen[v]; !ok {
8 result = append(result, v)
9 seen[v] = struct{}{}
10 }
11 }
12 return result
13}

Callers 4

UniqueListFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected