github.com/wtfutil/wtf@v0.43.0/utils/sums.go (about) 1 package utils 2 3 // SumInts takes a slice of ints and returns the sum of them 4 func SumInts(vals []int) int { 5 sum := 0 6 7 for _, a := range vals { 8 sum += a 9 } 10 11 return sum 12 }