mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
move stringInSlice to separate as ElementInSlice
This commit is contained in:
parent
8111f14da3
commit
136d970fec
1 changed files with 10 additions and 0 deletions
10
utils/std.go
Normal file
10
utils/std.go
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
package utils
|
||||
|
||||
func ElementInSlice[T comparable](check T, toCheck []T) bool {
|
||||
for _, item := range toCheck {
|
||||
if check == item {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue