Files
songquanpeng--one-api/common/utils/array.go
T
wehub-resource-sync f6211b6268
CI / Unit tests (push) Has been cancelled
CI / commit_lint (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:37:24 +08:00

14 lines
239 B
Go

package utils
func DeDuplication(slice []string) []string {
m := make(map[string]bool)
for _, v := range slice {
m[v] = true
}
result := make([]string, 0, len(m))
for v := range m {
result = append(result, v)
}
return result
}