Skip to content

Instantly share code, notes, and snippets.

@elc49
Last active February 11, 2024 11:04
Show Gist options
  • Save elc49/a58dceec45e010046aaf0100da0d9a13 to your computer and use it in GitHub Desktop.
Save elc49/a58dceec45e010046aaf0100da0d9a13 to your computer and use it in GitHub Desktop.
type ConditionIterator func(interface{}, int) bool
func Some(array []interface{}, iterator ConditionIterator) bool {
res := false
for index, data := range array {
res = res || iterator(data, index)
}
return res
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment