aboutsummaryrefslogtreecommitdiff
path: root/doc/play/fib.go
diff options
context:
space:
mode:
Diffstat (limited to 'doc/play/fib.go')
-rw-r--r--doc/play/fib.go19
1 files changed, 0 insertions, 19 deletions
diff --git a/doc/play/fib.go b/doc/play/fib.go
deleted file mode 100644
index 19e4721028..0000000000
--- a/doc/play/fib.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package main
-
-import "fmt"
-
-// fib returns a function that returns
-// successive Fibonacci numbers.
-func fib() func() int {
- a, b := 0, 1
- return func() int {
- a, b = b, a+b
- return a
- }
-}
-
-func main() {
- f := fib()
- // Function calls are evaluated left-to-right.
- fmt.Println(f(), f(), f(), f(), f())
-}