mirror of
https://github.com/thomiceli/opengist.git
synced 2025-07-12 19:01:50 +02:00
Add log output config option (#172)
Co-authored-by: Thomas Miceli <27960254+thomiceli@users.noreply.github.com>
This commit is contained in:

committed by
Thomas Miceli

parent
3c97901995
commit
4bba26daf6
@ -8,3 +8,15 @@ func SliceContains(slice []string, item string) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
Reference in New Issue
Block a user