rename goutils to obiutils

Former-commit-id: 2147f53db972bba571dfdae30c51b62d3e69cec5
This commit is contained in:
coissac committed 2023-03-24 10:25:12 +07:00
1 parent 42aae88520
commit d5e84ec676
33 files changed
+245 -156

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
package obiutils
func Contains[T comparable](arr []T, x T) bool {
for _, v := range arr {
if v == x {
return true
}
}
return false
}
func LookFor[T comparable](arr []T, x T) int {
for i, v := range arr {
if v == x {
return i
}
}
return -1
}
func RemoveIndex[T comparable](s []T, index int) []T {
return append(s[:index], s[index+1:]...)
}