MCPcopy
hub / github.com/cortexlabs/cortex / UniqueStrings

Function UniqueStrings

pkg/lib/slices/string.go:68–78  ·  view source on GitHub ↗
(strs []string)

Source from the content-addressed store, hash-verified

66}
67
68func UniqueStrings(strs []string) []string {
69 keys := strset.New()
70 out := []string{}
71 for _, elem := range strs {
72 if !keys.Has(elem) {
73 keys.Add(elem)
74 out = append(out, elem)
75 }
76 }
77 return out
78}
79
80func RemoveEmpties(strs []string) []string {
81 var cleanStrs []string

Callers

nothing calls this directly

Calls 3

NewFunction · 0.92
HasMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected