add InSlice
This commit is contained in:
parent
058f350ad0
commit
2d3c89af28
1 changed files with 10 additions and 0 deletions
10
util/slice.go
Normal file
10
util/slice.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
package util
|
||||
|
||||
func InSlice(str string, values []string) bool {
|
||||
for _, v := range values {
|
||||
if str == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
Loading…
Reference in a new issue