mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
use slices.Contains from go1.21
This commit is contained in:
parent
b3abd0bf1d
commit
28d9a7ff63
2 changed files with 2 additions and 10 deletions
|
|
@ -35,12 +35,3 @@ func CopyMap[K comparable, V any](input map[K]V) (result map[K]V) {
|
|||
}
|
||||
return
|
||||
}
|
||||
|
||||
func SliceContains[T comparable](slice []T, elem T) (result bool) {
|
||||
for _, t := range slice {
|
||||
if elem == t {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue