mirror of
https://github.com/onyx-and-iris/vbantxt.git
synced 2024-11-21 17:30:49 +00:00
11 lines
149 B
Go
11 lines
149 B
Go
|
package vbantxt
|
||
|
|
||
|
func indexOf[T comparable](collection []T, e T) int {
|
||
|
for i, x := range collection {
|
||
|
if x == e {
|
||
|
return i
|
||
|
}
|
||
|
}
|
||
|
return -1
|
||
|
}
|