kleinTodo/common/filter.go

11 lines
154 B
Go
Raw Permalink Normal View History

2025-07-26 23:31:00 +02:00
package common
func Filter[T any](ss []T, test func(T) bool) (ret []T) {
for _, s := range ss {
if test(s) {
ret = append(ret, s)
}
}
return
}