Skip to content

Commit

Permalink
fix: Update LastIndexOf sample code in README.rst
Browse files Browse the repository at this point in the history
after testing, the result of `funk.LastIndexOf([]string{"foo", "bar"}, func(value string) bool {
    return value == "bar"
})` is 1, and I gusse that this sample code may missed a "bar"
  • Loading branch information
hitjackma committed May 16, 2023
1 parent df17a63 commit 26e3d21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ if the value cannot be found.
// slice of string
funk.LastIndexOf([]string{"foo", "bar", "bar"}, "bar") // 2
funk.LastIndexOf([]string{"foo", "bar"}, func(value string) bool {
funk.LastIndexOf([]string{"foo", "bar", "bar"}, func(value string) bool {
return value == "bar"
}) // 1
}) // 2
funk.LastIndexOf([]string{"foo", "bar"}, "gilles") // -1
see also, typesafe implementations: LastIndexOfInt_, LastIndexOfInt64_, LastIndexOfFloat32_, LastIndexOfFloat64_, LastIndexOfString_
Expand Down

0 comments on commit 26e3d21

Please sign in to comment.