第二章全部写完
This commit is contained in:
34
2.8.md
Normal file
34
2.8.md
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
#2.8总结
|
||||||
|
|
||||||
|
这一章我们主要介绍了Go语言的一些语法,通过语法我们可以发现Go是多么的简单,只有二十五个关键字。让我们再来回顾一下这些关键字都是用来干什么的。
|
||||||
|
|
||||||
|
break default func interface select
|
||||||
|
case defer go map struct
|
||||||
|
chan else goto package switch
|
||||||
|
const fallthrough if range type
|
||||||
|
continue for import return var
|
||||||
|
|
||||||
|
- var和const参考2.2Go语言基础里面的变量和常量申明
|
||||||
|
- package和import已经有过短暂的接触
|
||||||
|
- func 用于定义函数和方法
|
||||||
|
- return 用于从函数返回
|
||||||
|
- defer用于类似析构函数
|
||||||
|
- go 用于并行
|
||||||
|
- select 用于选择不同类型的通讯
|
||||||
|
- interface用于定义接口,参考2.6小节
|
||||||
|
- struct 用于定义抽象数据类型,参考2.5小节
|
||||||
|
- break、case、continue、for、fallthrough、else、if、switch、goto、default这些参考2.3流程介绍里面
|
||||||
|
- chan用于channel通讯
|
||||||
|
- type用于什么自定义类似
|
||||||
|
- map用于什么map类型数据
|
||||||
|
- range用于读取slice、map、channel数据
|
||||||
|
|
||||||
|
上面这二十五个关键字记住了,那么Go你也已经差不多学会了。
|
||||||
|
|
||||||
|
## links
|
||||||
|
* [目录](<preface.md>)
|
||||||
|
* 上一节: [并发](<2.7.md>)
|
||||||
|
* 下一章: [Go开发博客系统](<3.md>)
|
||||||
|
|
||||||
|
## LastModified
|
||||||
|
* $Id$
|
||||||
3
2.md
3
2.md
@@ -8,8 +8,7 @@
|
|||||||
* 5. [面向对象](2.5.md)
|
* 5. [面向对象](2.5.md)
|
||||||
* 6. [interface](2.6.md)
|
* 6. [interface](2.6.md)
|
||||||
* 7. [并发](2.7.md)
|
* 7. [并发](2.7.md)
|
||||||
* 8. [通讯](2.8.md)
|
* 8. [小结](2.8.md)
|
||||||
* 9. [小结](2.9.md)
|
|
||||||
|
|
||||||
GO是一门类似C的编译性语言,但是他的编译速度非常快,这门语言的关键字加起来也就二十五个,比英文字母的二十六还少一个,这对于我们来说学习就变得简单了很多,先让我们看一眼这些关键字都长成怎么样:
|
GO是一门类似C的编译性语言,但是他的编译速度非常快,这门语言的关键字加起来也就二十五个,比英文字母的二十六还少一个,这对于我们来说学习就变得简单了很多,先让我们看一眼这些关键字都长成怎么样:
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,7 @@
|
|||||||
- 2.5. [面向对象](2.5.md)
|
- 2.5. [面向对象](2.5.md)
|
||||||
- 2.6. [interface](2.6.md)
|
- 2.6. [interface](2.6.md)
|
||||||
- 2.7. [并发](2.7.md)
|
- 2.7. [并发](2.7.md)
|
||||||
- 2.8. [通讯](2.8.md)
|
- 2.8. [小结](2.8.md)
|
||||||
- 2.9. [小结](2.9.md)
|
|
||||||
* 3.[设计开发博客系统](3.md)
|
* 3.[设计开发博客系统](3.md)
|
||||||
* 4.如何实现路由
|
* 4.如何实现路由
|
||||||
* 5.web语言处理
|
* 5.web语言处理
|
||||||
|
|||||||
Reference in New Issue
Block a user