关键字
Go有25个关键字
引导程序整体结构的有8个关键字:
package //定义包名
import //导入包名
const //常量声明
var //变量声明
func //函数定义
defer //延迟调用
go //并发语法
return //函数返回
声明复合数据结构的有4个关键字:
struct //定义结构类型
interface //定义接口
map //声明或创建map类型
chan //声明或创建通道类型
控制程序结构的有13个关键字:
if else //if else语句
for range break continue //for循环使用
switch select type case default fallthrough //switch和select语句
goto //goto语句跳转
数据类型标识符
数值(16个)
整型(12个):byte int int8 int16 int32 int64
uint uint8 uint 16 uint32 uint64 uintprt
浮点型(2个): float32 float64
复数型(2个): complex64 complex128
字符和字符串型(2个)
string rune
接口型(1个)
error
布尔型(1个)
bool
内置函数标识符
make
new
len
cap
append
copy
delete
panic
recover
close
complex
real
image
Println
常量值标识符
true false
iota
nil
空白标识符
_