Skip to content

Instantly share code, notes, and snippets.

View exercise-fibonacci-closure.go
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
prev, next := -1, 1
return func() int {