mirror of
https://github.com/ProtonMail/go-proton-api.git
synced 2026-04-25 01:14:58 -04:00
10 lines
171 B
Go
10 lines
171 B
Go
package utils
|
|
|
|
import "slices"
|
|
|
|
func Filter[S ~[]E, E any](s S, keep func(E) bool) S {
|
|
return slices.DeleteFunc(slices.Clone(s), func(e E) bool {
|
|
return !keep(e)
|
|
})
|
|
}
|