Commit Graph

993 Commits

Author SHA1 Message Date
Xargin
9eecd0f991 fix typo
diff --git a/ch2/ch2-07.md b/ch2/ch2-07.md
index f5e75f4..b74cfdd 100644
--- a/ch2/ch2-07.md
+++ b/ch2/ch2-07.md
@@ -12,7 +12,7 @@

 一个程序可能包含多个同名的声明,只要它们在不同的词法域就没有关系。例如,你可以声明一个局部变量,和包级的变量同名。或者是像2.3.3节的例子那样,你可以将一个函数参数的名字声明为new,虽然内置的new是全局作用域的。但是物极必反,如果滥用不同词法域可重名的特性的话,可能导致程序很难阅读。

-当编译器遇到一个名字引用时,如果它看起来像一个声明,它首先从最内层的词法域向全局的作用域查找。如果查找失败,则报告“未声明的名字”这样的错误。如果该名字在内部和外部的块分别声明过,则内部块的声明首先被找到。在这种情况下,内部声明屏蔽了外部同名的声明,让外部的声明的名字无法被访问:
+当编译器遇到一个名字引用时,它会对其定义进行查找,查找过程从最内层的词法域向全局的作用域进行。如果查找失败,则报告“未声明的名字”这样的错误。如果该名字在内部和外部的块分别声明过,则内部块的声明首先被找到。在这种情况下,内部声明屏蔽了外部同名的声明,让外部的声明的名字无法被访问:

 ```Go
 func f() {}
2018-02-23 15:49:02 +08:00
Xargin
bc9c93eec7
Merge pull request #51 from iamybj/master
readme.md 和 preferd.md 预览网址保持一致
2018-02-23 14:00:04 +08:00
iamybj
3587f6a931
Update preface.md 2018-02-22 12:57:20 +08:00
iamybj
9689a66054
Update README.md 2018-02-22 12:56:00 +08:00
iamybj
701c69dabc
Update preface.md 2018-02-22 12:55:15 +08:00
Xargin
9ac3956583 Merge branch 'master' of https://github.com/gopl-zh/gopl-zh.github.com 2018-01-17 17:45:45 +08:00
Xargin
72b9bfe173 fix 2018-01-17 17:45:27 +08:00
Xargin
a5efe7a0dd
Merge pull request #50 from wukoo/patch-3
Update ch5-04-1.md
2018-01-01 20:14:46 +08:00
wukoo
3f8f4a0531
Update ch5-04-1.md
翻译错误。
2018-01-01 16:43:56 +08:00
Xargin
d493b63b5e
Merge pull request #45 from qinhanlei/patch-14
Update ch12-07.md
2017-12-15 15:31:18 +08:00
Xargin
3484a16c92
Merge pull request #46 from qinhanlei/patch-15
Update ch12-07.md
2017-12-15 15:30:57 +08:00
Xargin
4d1683a00b
Merge pull request #47 from qinhanlei/patch-16
Update SUMMARY.md
2017-12-15 15:30:42 +08:00
Xargin
06093965fd
Merge pull request #48 from qinhanlei/patch-17
Update ch12-09.md
2017-12-15 15:30:22 +08:00
Hanlei Qin
81a0ef3317
Update ch12-09.md 2017-12-15 14:46:04 +08:00
Hanlei Qin
fc760171e1
Update SUMMARY.md 2017-12-15 14:24:25 +08:00
Hanlei Qin
b2792e2ea8
Update ch12-07.md 2017-12-15 14:22:51 +08:00
Hanlei Qin
e0bb46ea95
Update ch12-07.md 2017-12-15 14:19:27 +08:00
Xargin
214cac4095 uupdate 2017-12-11 19:14:11 +08:00
Xargin
a2a5cd9d9d Merge branch 'master' of https://github.com/gopl-zh/gopl-zh.github.com 2017-12-11 19:12:51 +08:00
Xargin
29140c015f fix order 2017-12-11 19:12:31 +08:00
Xargin
2f6a87500f
Merge pull request #43 from qinhanlei/patch-13
Update ch10-06.md
2017-12-06 23:05:20 +08:00
Hanlei Qin
84d5d2bf5e
Update ch10-06.md 2017-12-06 22:37:52 +08:00
Xargin
9e043e30cc
Merge pull request #41 from qinhanlei/patch-11
Update SUMMARY.md
2017-12-06 18:41:40 +08:00
Xargin
c151f224a6
Merge pull request #42 from qinhanlei/patch-12
Update ch9-05.md
2017-12-06 18:41:19 +08:00
Hanlei Qin
7c0b29af8e
Update ch9-05.md 2017-12-06 18:29:24 +08:00
Hanlei Qin
e287bc9f23
Update SUMMARY.md 2017-12-06 18:27:50 +08:00
Xargin
3e97cdf96b
Merge pull request #40 from qinhanlei/patch-10
Update ch9-02.md
2017-12-06 15:43:38 +08:00
Hanlei Qin
c1b75dda19
Update ch9-02.md 2017-12-06 14:14:13 +08:00
Xargin
e0dfb180d4
Merge pull request #36 from qinhanlei/patch-6
Update ch8-10.md
2017-12-06 10:46:08 +08:00
Xargin
24e0e40d6b
Merge pull request #37 from qinhanlei/patch-7
Update ch9-01.md
2017-12-06 10:45:32 +08:00
Xargin
97c96badd5
Merge pull request #38 from qinhanlei/patch-8
Update ch9-01.md
2017-12-06 10:45:11 +08:00
Xargin
666c61a7fd
Merge pull request #39 from qinhanlei/patch-9
Update ch9-01.md
2017-12-06 10:44:49 +08:00
Hanlei Qin
4283571cf3
Update ch9-01.md 2017-12-06 00:20:55 +08:00
Hanlei Qin
75a37c1066
Update ch9-01.md 2017-12-05 23:20:21 +08:00
Hanlei Qin
dfefed699c
Update ch9-01.md 2017-12-05 22:47:19 +08:00
Hanlei Qin
7b3d3a6aad
Update ch8-10.md 2017-12-05 20:59:49 +08:00
Xargin
d9c9556a66
Merge pull request #35 from qinhanlei/patch-5
Update ch8-08.md
2017-12-05 16:07:00 +08:00
Xargin
4f1467f543
Merge pull request #34 from qinhanlei/patch-4
Update SUMMARY.md
2017-12-05 16:05:57 +08:00
Hanlei Qin
e1358aac86
Update ch8-08.md 2017-12-05 00:20:21 +08:00
Hanlei Qin
620a1c7fd1
Update SUMMARY.md 2017-12-04 22:56:28 +08:00
Xargin
5230387840
Merge pull request #32 from qinhanlei/patch-2
Update ch8-04-1.md
2017-12-02 19:38:01 +08:00
Xargin
8f98ee0188
Merge pull request #33 from qinhanlei/patch-3
Update ch8-04-4.md
2017-12-02 19:37:34 +08:00
Hanlei Qin
74e4184c86
Update ch8-04-4.md 2017-12-02 17:19:21 +08:00
Hanlei Qin
ce363dd19e
Update ch8-04-1.md 2017-12-02 16:08:06 +08:00
Xargin
374c07ae38
Merge pull request #31 from qinhanlei/patch-1
Update ch7-13.md
2017-12-01 11:43:53 +08:00
Hanlei Qin
d280c6c7aa
Update ch7-13.md 2017-12-01 00:08:06 +08:00
Xargin
9ca3fd63f0
Merge pull request #30 from mifaly/patch-1
Update ch5-07.md
2017-11-30 12:57:44 +08:00
MiFalyzz
740cc92d15
Update ch5-07.md
interface{} 而不是 interfac{}
2017-11-30 11:25:28 +08:00
Xargin
c1b0a703bc
Merge pull request #29 from A1014280203/master
补充sync.Once描述
2017-11-28 14:20:25 +08:00
A1014280203
3a284d83e3
补充sync.Once描述
补充了go1.9中,sync.Once的新实现方式带来的不同。
2017-11-28 12:01:30 +08:00