chore: get or remove by states

This commit is contained in:
Noah Hsu
2022-06-23 21:19:01 +08:00
parent 6c61f1d261
commit 92983aa185
5 changed files with 26 additions and 14 deletions

View File

@ -11,3 +11,12 @@ func SliceEqual[T comparable](a, b []T) bool {
}
return true
}
func SliceContains[T comparable](arr []T, v T) bool {
for _, vv := range arr {
if vv == v {
return true
}
}
return false
}