mirror of
https://github.com/prymitive/karma
synced 2026-05-27 05:03:09 +00:00
22 lines
457 B
Go
22 lines
457 B
Go
package slices
|
|
|
|
// BoolInSlice returns true if given bool is found in a slice of bools
|
|
func BoolInSlice(boolArray []bool, value bool) bool {
|
|
for _, s := range boolArray {
|
|
if s == value {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// StringInSlice returns true if given string is found in a slice of strings
|
|
func StringInSlice(stringArray []string, value string) bool {
|
|
for _, s := range stringArray {
|
|
if s == value {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|