fix: variadic function

pull/82/head
Hongbo Miao 2020-03-12 13:09:52 +08:00 committed by GitHub
parent bf67e042e9
commit 252edd5485
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@
<u><i>gopl.io/ch5/sum</i></u>
```Go
func sum(vals...int) int {
func sum(vals ...int) int {
total := 0
for _, val := range vals {
total += val