Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Go-Learning-Land/Go-Learning-Archive
/ main
Function
main
GolangBasics/GoByExample/014VariadicFunc.go:14–21 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
12
}
13
14
func
main() {
15
16
sum(1, 2)
17
sum(1, 2, 3)
18
19
nums := []int{1, 2, 3, 4}
//If you already have multiple args in a slice, apply them to a variadic function using func(slice...) like this.
20
sum(nums...)
21
}
Callers
nothing calls this directly
Calls
1
sum
Function · 0.70
Tested by
no test coverage detected