Skip to content

Commit 563046f

Browse files
committed
1 parent b012bf3 commit 563046f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ebook/02.7.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ channel通过操作符`<-`来接收和发送数据
6868
import "fmt"
6969

7070
func sum(a []int, c chan int) {
71-
sum := 0
71+
total := 0
7272
for _, v := range a {
73-
sum += v
73+
total += v
7474
}
75-
c <- sum // send sum to c
75+
c <- total // send total to c
7676
}
7777

7878
func main() {

0 commit comments

Comments
 (0)