Merge commit '563046f4c84545b0558830fa533c17858a09c964' into ja

This commit is contained in:
Shin Kojima
2013-12-25 03:41:47 +09:00

View File

@@ -68,11 +68,11 @@ channel通过操作符`<-`来接收和发送数据
import "fmt"
func sum(a []int, c chan int) {
sum := 0
total := 0
for _, v := range a {
sum += v
total += v
}
c <- sum // send sum to c
c <- total // send total to c
}
func main() {