go factorial recursion code example
Example: golang factorial recursion
func fact(n int) int {
if n == 0 {
return 1
}
return n * fact(n-1)
}
func fact(n int) int {
if n == 0 {
return 1
}
return n * fact(n-1)
}