mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2024-11-16 11:23:40 +00:00
commit
b09d03dc2a
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<u><i>gopl.io/ch5/sum</i></u>
|
<u><i>gopl.io/ch5/sum</i></u>
|
||||||
```Go
|
```Go
|
||||||
func sum(vals...int) int {
|
func sum(vals ...int) int {
|
||||||
total := 0
|
total := 0
|
||||||
for _, val := range vals {
|
for _, val := range vals {
|
||||||
total += val
|
total += val
|
||||||
|
Loading…
Reference in New Issue
Block a user