mirror of
https://github.com/thomiceli/opengist.git
synced 2024-12-22 20:42:40 +00:00
4215d7e43b
Go 1.20 -> 1.21 JS package-lock Nodejs Docker 18 -> 20 Alpine Docker 3.17 -> 3.19
13 lines
268 B
Go
13 lines
268 B
Go
package utils
|
|
|
|
func RemoveDuplicates[T string | int](sliceList []T) []T {
|
|
allKeys := make(map[T]bool)
|
|
list := []T{}
|
|
for _, item := range sliceList {
|
|
if _, value := allKeys[item]; !value {
|
|
allKeys[item] = true
|
|
list = append(list, item)
|
|
}
|
|
}
|
|
return list
|
|
}
|