0
0
mirror of https://github.com/thegeeklab/drone-admin.git synced 2024-11-15 04:00:40 +00:00
drone-admin/admin/util/util.go

12 lines
185 B
Go
Raw Normal View History

2022-07-20 15:12:41 +00:00
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
}