13 lines
220 B
Go
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
|
|
}
|