mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
13 lines
173 B
Go
13 lines
173 B
Go
package utils
|
|
|
|
// SumInts takes a slice of ints and returns the sum of them
|
|
func SumInts(vals []int) int {
|
|
sum := 0
|
|
|
|
for _, a := range vals {
|
|
sum += a
|
|
}
|
|
|
|
return sum
|
|
}
|