2018-02-28 16:49:01 +01:00
|
|
|
package util
|
|
|
|
|
2018-05-17 01:42:06 +02:00
|
|
|
import "strings"
|
|
|
|
|
2018-02-28 16:49:01 +01:00
|
|
|
func InSlice(str string, values []string) bool {
|
|
|
|
for _, v := range values {
|
|
|
|
if str == v {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
2018-05-17 01:42:06 +02:00
|
|
|
|
2018-06-06 23:47:28 +02:00
|
|
|
func InSliceContains(fullString string, candidates []string) bool {
|
|
|
|
for _, v := range candidates {
|
|
|
|
if strings.Contains(fullString, v) {
|
2018-05-17 01:42:06 +02:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|