Skip to content

Commit ade4760

Browse files
authored
非阻塞通道操作补全翻译 (#73)
感谢贡献!
1 parent 4d3b31d commit ade4760

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/non-blocking-channel-operations/non-blocking-channel-operations.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ func main() {
2020
fmt.Println("no message received")
2121
}
2222

23-
// 一个非阻塞发送的实现方法和上面一样。
23+
// 一个非阻塞发送的例子,代码结构和上面接收的类似。
24+
// `msg` 不能被发送到 `message` 通道,因为这是
25+
// 个无缓冲区通道,并且也没有接收者,因此, `default`
26+
// 会执行。
2427
msg := "hi"
2528
select {
2629
case messages <- msg:

0 commit comments

Comments
 (0)