Skip to content

Instantly share code, notes, and snippets.

@NaniteFactory
Created January 25, 2019 17:19
Show Gist options
  • Save NaniteFactory/a3bbaaa3079fb4e30cbe299132064577 to your computer and use it in GitHub Desktop.
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
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