12 lines
167 B
Go
12 lines
167 B
Go
package utils
|
|
|
|
func All[T comparable](slice []T, condition func(T) bool) bool {
|
|
|
|
for _, v := range slice {
|
|
if !condition(v) {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
}
|