Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "log"
- )
- func sum(args ...float64) float64 {
- sum := 0.0
- for _, e := range args {
- sum += e
- }
- return sum
- }
- func main() {
- s := sum(1, 2, 3, 4, 5)
- if !(s == 15.0) {
- log.Fatal("Wrong value")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement