muldap/lib/util/slice.go
2018-07-15 23:27:27 -04:00

13 lines
220 B
Go

package util
// returns true if the needle exists in the haystack
func ContainsString(haystack []string, needle string) bool {
for _, val := range haystack {
if val == needle {
return true
}
}
return false
}