Skip to content

Commit 7fe72e8

Browse files
committed
Merge pull request astaxie#304 from mikulely/patch-6
调整示例程序格式
2 parents 9b2cdb6 + ed8cae7 commit 7fe72e8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ebook/02.7.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ goroutine是通过Go的runtime管理的一个线程管理器。goroutine通过`g
3131
say("hello") //当前Goroutines执行
3232
}
3333

34-
输出
35-
hello
36-
world
37-
hello
38-
world
39-
hello
40-
world
41-
hello
42-
world
43-
hello
34+
// 以上程序执行后将输出
35+
// hello
36+
// world
37+
// hello
38+
// world
39+
// hello
40+
// world
41+
// hello
42+
// world
43+
// hello
4444

4545
我们可以看到go关键字很方便的就实现了并发编程。
4646
上面的多个goroutine运行在同一个进程里面,共享内存数据,不过设计上我们要遵循:不要通过共享来通信,而要通过通信来共享。

0 commit comments

Comments
 (0)