Todo: add todo for playground demo of function

This commit is contained in:
dudaodong committed 2023-01-07 18:27:07 +08:00
1 parent 2f184907ff
commit 278733d3d1
6 files changed
+14 -11

No files matched your search

+1
View File
@@ -10,6 +10,7 @@ import "github.com/duke-git/lancet/v2/lancetconstraints"
// LinearSearch return the index of target in slice base on equal function.
// If not found return -1
// Play: Todo
func LinearSearch[T any](slice []T, target T, equal func(a, b T) bool) int {
for i, v := range slice {
if equal(v, target) {