Created
January 25, 2019 17:19
-
-
Save NaniteFactory/a3bbaaa3079fb4e30cbe299132064577 to your computer and use it in GitHub Desktop.
a Golang function that takes multiple numbers as its parameter then returns the sum of those
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sum := func(nums ...float64) float64 { | |
ret := 0.0 | |
for _, num := range nums { | |
ret += num | |
} | |
return ret | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment