muldap/lib/util/slice.go

13 lines
220 B
Go
Raw Normal View History

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
}