From 252edd5485706e4082091413dc1bad96e0032610 Mon Sep 17 00:00:00 2001 From: Hongbo Miao Date: Thu, 12 Mar 2020 13:09:52 +0800 Subject: [PATCH] fix: variadic function --- ch5/ch5-07.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch5/ch5-07.md b/ch5/ch5-07.md index 8c5e2db..7ce3bff 100644 --- a/ch5/ch5-07.md +++ b/ch5/ch5-07.md @@ -6,7 +6,7 @@ gopl.io/ch5/sum ```Go -func sum(vals...int) int { +func sum(vals ...int) int { total := 0 for _, val := range vals { total += val