package main import log func main log Print fib func fib uint uint if

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
package main
import "log"
func main() {
log.Print(fib(2))
}
func fib(i uint) uint {
if i == 0 {
return 0
}
if i == 1 {
return 1
}
i = i - 1
return fib(i-1) + fib(i)
}