Slice: find v2 (#17)

* If slice len is zero then return false
* Convert find to generic form.
* If return T is nil then no items matched the predicate func
This commit is contained in:
donutloop authored and GitHub committed 2022-01-07 20:19:27 +08:00
1 parent 3e9a2b5c59
commit 30d798366b
4 files changed
+14 -19

No files matched your search

+1 -1
View File
@@ -220,7 +220,7 @@ func TestFind(t *testing.T) {
t.Fatal("found nothing")
}
if res != 2 {
if *res != 2 {
internal.LogFailedTestInfo(t, "Find", nums, 2, res)
t.FailNow()
}