mirror of
https://github.com/turbot/steampipe.git
synced 2026-04-12 10:00:06 -04:00
Update check templates to remove functions. Closes #1320
This commit is contained in:
14
utils/string_slice.go
Normal file
14
utils/string_slice.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package utils
|
||||
|
||||
// TODO: investigate turbot/go-kit/helpers
|
||||
func StringSliceDistinct(slice []string) []string {
|
||||
var res []string
|
||||
occurenceMap := make(map[string]struct{})
|
||||
for _, item := range slice {
|
||||
occurenceMap[item] = struct{}{}
|
||||
}
|
||||
for item := range occurenceMap {
|
||||
res = append(res, item)
|
||||
}
|
||||
return res
|
||||
}
|
||||
Reference in New Issue
Block a user