Skip to content

Commit

Permalink
docs: update description for FindOrElse (#370)
Browse files Browse the repository at this point in the history
* docs: update description for FindOrElse

* Update README.md

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
  • Loading branch information
slomek and samber committed Dec 19, 2023
1 parent 46aca3d commit 71d8341
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -1824,7 +1824,7 @@ str, index, ok := lo.FindLastIndexOf([]string{"foobar"}, func(i string) bool {

### FindOrElse

Search an element in a slice based on a predicate. It returns element and true if element was found.
Search an element in a slice based on a predicate. It returns the element if found or a given fallback value otherwise.

```go
str := lo.FindOrElse([]string{"a", "b", "c", "d"}, "x", func(i string) bool {
Expand Down

0 comments on commit 71d8341

Please sign in to comment.