GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • All gists
  • Back to GitHub
  • Sign in
  • Sign up
  • Code
  • Revisions 2
  • Terms
  • Privacy
  • Security
  • Status
  • Community
  • Docs
  • Contact

This view

  • Original page
  • New address

GeezerVison is showing gist.github.com — some.go

Instantly share code, notes, and snippets.

@elc49

elc49/some.go

Last active February 11, 2024 11:04
Show Gist options
  • Download ZIP
  • Star 0 (0) You must be signed in to star a gist
  • Fork 0 (0) You must be signed in to fork a gist
  • Clone this repository at <script src="https://gist.github.com/elc49/a58dceec45e010046aaf0100da0d9a13.js"></script>
  • Save elc49/a58dceec45e010046aaf0100da0d9a13 to your computer and use it in GitHub Desktop.
Clone this repository at <script src="https://gist.github.com/elc49/a58dceec45e010046aaf0100da0d9a13.js"></script>
Save elc49/a58dceec45e010046aaf0100da0d9a13 to your computer and use it in GitHub Desktop.
Download ZIP
Raw
some.go
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
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.