Skip to content

Instantly share code, notes, and snippets.

@glennblock
Last active October 11, 2015 04:11
Show Gist options
  • Save glennblock/6520ad1db52245ac2345 to your computer and use it in GitHub Desktop.
Save glennblock/6520ad1db52245ac2345 to your computer and use it in GitHub Desktop.
package main
import "fmt"
func iterator(start, end int, action func(int)) {
for i:=start; i<=end; i++ {
action(i)
}
}
func main() {
iterator(1,10,func(idx int) {
fmt.Println(idx)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment