GO基础深刻总结

GO的关键字:
包管理:package、import
变量:var、map、struct、interface、const、type
函数:func、return、defer
循环:if、else、switch、case、fallthought、default、for、break、continue、goto、range
并发:go、chan、select数组

GO的变量类型:
(1)整型
int(默认)、int八、int1六、int3二、int6四、byte
uint、uint八、uint1六、uint3二、uint64
(2)浮点型:float3二、float64(默认)
(3)复数:complex6四、complex128(默认)
(4)数组:值拷贝、不一样长度和不一样类型的数组都是一个新类型
(5)切片:引用
(6)map:引用
(7)复合类型:interface、struct并发

GO的内置函数:append、cap、new、make、copy、len、delete、panic、recover
(1)append:向切片中添加一个或多个值app

// 注意:有个潜在的问题,看下面的代码
package main函数

import "fmt"ui

func main() {it

相关文章
相关标签/搜索