#### History of Idiom 31 > diff from v20 to v21

Edit summary for version 21 :

New Go implementation by user [lck]

New Go implementation by user [lck]

↷

#### Version 20

2015-11-30, 12:37:27

#### Version 21

2016-01-01, 00:27:18

# Idiom #31 Recursive factorial (simple)

Create recursive function f which returns the factorial of non-negative integer i, calculated from f(i-1)

# Idiom #31 Recursive factorial (simple)

Create recursive function f which returns the factorial of non-negative integer i, calculated from f(i-1)

##### Code

func f(i int) int { if i == 0 { return 1 } return i * f(i-1) }