SliceContainsAny returns true if it finds an item in the slice where `predicate` returns true
(slice []T, predicate func(item T) bool)
| 71 | |
| 72 | // SliceContainsAny returns true if it finds an item in the slice where `predicate` returns true |
| 73 | func SliceContainsAny[T comparable](slice []T, predicate func(item T) bool) bool { |
| 74 | for _, item := range slice { |
| 75 | if predicate(item) { |
| 76 | return true |
| 77 | } |
| 78 | } |
| 79 | return false |
| 80 | } |
| 81 | |
| 82 | // SliceContainsAll returns true if it finds that all items in the slice for which `predicate` returns true |
| 83 | func SliceContainsAll[T comparable](slice []T, predicate func(item T) bool) bool { |
no outgoing calls
no test coverage detected