You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
scrutiny/vendor/github.com/analogj/go-util/utils/slice.go

20 lines
313 B

package utils
func SliceIncludes(slice []string, item string) bool {
for _, val := range slice {
if val == item {
return true
}
}
return false
}
//func indexOf(answers []interface{}, item interface{}) (int) {
// for k, v := range answers {
// if v == item {
// return k
// }
// }
// return -1
//}