788857d2c3
remove unneeded panics improve error handling add tests fix error checking that was comparing for exact values sort imports
21 lines
319 B
Go
21 lines
319 B
Go
package util
|
|
|
|
import "strings"
|
|
|
|
func InSlice(str string, values []string) bool {
|
|
for _, v := range values {
|
|
if str == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
func InSliceContains(str string, values []string) bool {
|
|
for _, v := range values {
|
|
if strings.Contains(v, str) {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|