修改表达不通顺的语句

This commit is contained in:
xinwendashibaike
2015-01-16 15:56:16 +08:00
parent 108aa12b39
commit 8e7e814cc6
2 changed files with 3 additions and 1 deletions

View File

@@ -110,6 +110,8 @@ channel通过操作符`<-`来接收和发送数据
fmt.Println(<-c)
fmt.Println(<-c)
}
//修改为1报如下的错误:
//fatal error: all goroutines are asleep - deadlock!
## Range和Close
上面这个例子中我们需要读取两次c这样不是很方便Go考虑到了这一点所以也可以通过range像操作slice或者map一样操作缓存类型的channel请看下面的例子