0
0
mirror of https://github.com/thegeeklab/drone-admin.git synced 2024-11-14 07:40:41 +00:00
drone-admin/admin/util/util.go
2022-07-20 17:12:41 +02:00

12 lines
185 B
Go

package util
func Filter[T any](vs []T, f func(T) bool) []T {
filtered := make([]T, 0)
for _, v := range vs {
if f(v) {
filtered = append(filtered, v)
}
}
return filtered
}