Skip to content

Instantly share code, notes, and snippets.

@siburu
Created January 25, 2016 07:40
Show Gist options
  • Save siburu/abc3d4f4ea281a5e53ab to your computer and use it in GitHub Desktop.
Save siburu/abc3d4f4ea281a5e53ab to your computer and use it in GitHub Desktop.
package main
type recFunc func(int, recFunc)
func call(n int, f recFunc) {
defer println("r", n)
println(n)
if n > 0 {
f(n-1, f)
}
}
func main() {
call(10, call)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment