1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-11-27 09:34:41 +01:00
gojekyll/helpers/arrays.go
Oliver Steele 3cafe70d59 Lint
2017-07-01 20:49:15 -04:00

15 lines
435 B
Go

package helpers
// SearchStrings returns a bool indicating whether array contains the string.
// Unlike sort.SearchStrings, it does not require a sorted array.
// This is useful when the array length is low; else consider sorting it and using
// sort.SearchStrings, or creating a map[string]bool.
func SearchStrings(array []string, s string) bool {
for _, item := range array {
if item == s {
return true
}
}
return false
}