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

11 lines
168 B
Go
Raw Normal View History

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
}