github.com/nibnait/go-learn@v0.0.0-20220227013611-dfa47ea6d2da/src/test/chapter/ch3/package/22_series/my_series.go (about)

     1  package _2_series
     2  
     3  import "fmt"
     4  
     5  func init() {
     6  	fmt.Println("init1")
     7  }
     8  
     9  func init() {
    10  	fmt.Println("init2")
    11  }
    12  
    13  func square(n int) int {
    14  	return n * n
    15  }
    16  
    17  func Square(n int) int {
    18  	return n * n
    19  }
    20  
    21  func GetFibonacciSerie(n int) []int {
    22  	ret := []int{1, 1}
    23  	for i := 2; i < n; i++ {
    24  		ret = append(ret, ret[i-2]+ret[i-1])
    25  	}
    26  	return ret
    27  }