thoas / go-funk

A modern Go utility library which provides helpers (map, find, contains, filter, ...)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Contains with func parameter for element

andig opened this issue · comments

commented

I would see this as similar to Filter but returning true/false instead of slice:

r := funk.Contains([]int{1, 2, 3, 4}, func(x int) bool {
    return x == 3
}) // true