packer-cn/builder/azure/common/strings_contains.go

14 lines
301 B
Go
Raw Normal View History

2020-03-25 17:38:05 -04:00
package common
import "strings"
// StringsContains returns true if the `haystack` contains the `needle`. Search is case insensitive.
func StringsContains(haystack []string, needle string) bool {
for _, s := range haystack {
if strings.EqualFold(s, needle) {
return true
}
}
return false
}