基本概念
1. 变量:
只能以字母或下划线_开头
2. 内置基本类型:
基本数据类型
byte、int(有符号- +)、int8、int16、int32、int64、uint(无符号)、uint8、uint32、uint64、 uintprt(无符号整型,存放指针)、float32、float64、complex64、complex128(复数)、String、error、bool
派生类型:
指针类型(Pointer)
数组类型
结构化类型(struct)
Channel 类型
函数类型
切片类型
接口类型(interface)
Map 类型
3. 内置函数:
make、new、len、cap、append、copy、delete、panic、recover、close、complex、real、image、Print Println
4. 常量值标识符:
true 、false、iota 连续的枚举类型声明、nil 引用型变量空的默认值
5. 空白标识符:
_(下划线)用来声明一个匿名变量,该变量在赋值表达式的左端,通常被用作占位
6. 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