Skip to content

Commit

Permalink
05.0.md
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon committed Jun 22, 2013
1 parent fac2467 commit 67be80c
Show file tree
Hide file tree
Showing 120 changed files with 506 additions and 7,307 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
该翻译版本已获得原作者(Ivo Balbaert)本人授权,并表示支持开源事业的发展!

##翻译进度
4.9 [指针](eBook/04.9.md)
第5章:[控制结构](eBook/05.0.md)

##支持本书
如果你喜欢本书《Go入门指南》,你可以参与到本书的翻译或纠正工作中来,具体请联系【无闻 E-mail:joe2010xtmf#163.com】,一同完善本书并帮助壮大 Go 语言在国内的学习群体,给大家提供更好的学习资源。
Expand Down
17 changes: 1 addition & 16 deletions eBook/05.0.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
##啊哦,亲,你看得也太快了。。。还没翻译完呢 0 0
要不等到 ***2013 年 6 月 20 日*** 再来看看吧~~

这里还有一些其它的学习资源噢~

- [《Go编程基础》](https://github.com/Unknwon/go-fundamental-programming):已更新至 [第12课](https://github.com/Unknwon/go-fundamental-programming/blob/master/lectures/lecture12.md)
- [《Go Web编程》](https://github.com/astaxie/build-web-application-with-golang)

神马?你说你不想学习?那好吧,去逛逛看看行情也行~

- [Go Walker](http://gowalker.org) **Go 项目文档在线浏览工具**
- [Golang中文社区](http://bbs.mygolang.com/forum.php)
- [Go语言学习园地](http://studygolang.com/)
- [Golang中国](http://golang.tc)

#5.0 控制结构
到目前为止,我们看到的都是 Go 程序都是从 main() 函数开始执行,然后按顺序执行该函数体中的代码。但我们经常会需要只有在满足一些特定情况时才执行某些代码,也就是说在代码里进行条件判断。针对这种需求,Go 提供了下面这些条件结构和分支结构:

if-else 结构
switch-else 结构
switch 结构
select 结构,用于 channel 的选择(第 14.4 节)

可以使用迭代或循环结构来重复执行一次或多次某段代码(任务):
Expand Down
17 changes: 16 additions & 1 deletion eBook/05.1.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
##啊哦,亲,你看得也太快了。。。还没翻译完呢 0 0
要不等到 ***2013 年 6 月 24 日*** 再来看看吧~~

这里还有一些其它的学习资源噢~

- [《Go编程基础》](https://github.com/Unknwon/go-fundamental-programming):已更新至 [第12课](https://github.com/Unknwon/go-fundamental-programming/blob/master/lectures/lecture12.md)
- [《Go Web编程》](https://github.com/astaxie/build-web-application-with-golang)

神马?你说你不想学习?那好吧,去逛逛看看行情也行~

- [Go Walker](http://gowalker.org) **Go 项目文档在线浏览工具**
- [Golang中文社区](http://bbs.mygolang.com/forum.php)
- [Go语言学习园地](http://studygolang.com/)
- [Golang中国](http://golang.tc)

#5.1 if-else 结构
if 是用于测试某个条件(布尔型或逻辑型)的语句,如果该条件成立,则会执行 if 后由大括号括起来的代码块,否则就忽略该代码块继续执行后续的代码。

Expand Down Expand Up @@ -189,4 +204,4 @@ if value := process(data); value > max {
##链接
- [目录](directory.md)
- 上一节:[控制结构](05.0.md)
- 下一节: [TODO](05.2.md)
- 下一节: [测试多返回值函数的错误](05.2.md)
5 changes: 5 additions & 0 deletions eBook/directory.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
- 4.9 [指针](04.9.md)
- 第5章:[控制结构](05.0.md)
- 5.1 [if-else 结构](05.1.md)
- 5.2 [测试多返回值函数的错误](05.2.md)
- 5.3 [switch 结构](05.3.md)
- 5.4 [for 结构](05.4.md)
- 5.5 [Break 与 continue](05.5.md)
- 5.6 [标签与 goto](05.6.md)
- 第6章:函数(function)
- 第7章:数组(array)与切片(slice)
- 第8章:Maps
Expand Down
Loading

0 comments on commit 67be80c

Please sign in to comment.