package arrays func Sum(a []int) int { sum := 0 //aternatively // for i := 0; i < 5; i++ { // sum += a[i] // } // OR // for i := range a { // sum += a[i] // } // OR for _, v := range a { sum += v } return sum } // The ... in the method signature means it's variadic function // meaning it takes a variable number of arguments // SumAll func SumAll(numbersToSum ...[]int) []int { return nil }