github.com/ks888/tgo@v0.0.0-20190130135156-80bf89407292/testutils/testdata/recursive.go (about)

     1  package main
     2  
     3  import "fmt"
     4  
     5  func dec(i, rem int) int {
     6  	if rem == 0 {
     7  		return i
     8  	}
     9  	return dec(i-1, rem-1)
    10  }
    11  
    12  func main() {
    13  	val := dec(1, 100)
    14  	fmt.Println(val)
    15  }