This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
e621-sdk-go/pkg/e621/utils/helper.go
2023-11-15 13:21:13 +01:00

11 lines
168 B
Go

package utils
func SliceFilter[T any](slice []T, filter func(T) bool) (ret []T) {
for _, s := range slice {
if filter(s) {
ret = append(ret, s)
}
}
return
}