This repository has been archived on 2024-09-06. You can view files and clone it, but cannot push or open issues or pull requests.

12 lines
205 B
Go

package utils
func Filter[T comparable](tSlice []T, filter func(t T) bool) []T {
result := make([]T, 0)
for _, t := range tSlice {
if filter(t) {
result = append(result, t)
}
}
return result
}