随笔分类 - Golang
Write it down to enhance the memory.
摘要:golang的数组是用花括号括起来的。 Method A method is just a function with a receiver. method: func (v type1) Abs() type2{ } v.Abs() function: func Abs(v type1) type
阅读全文
摘要:指针Pointer 定义 var p *int,zero value为nil p = &i 生成指向对象i的指针 *p 实际操作的是 i 结构体struct type Vertex struct{ X, Y int } 使用点获取结构体变量的字段值 结构体变量可如此初始化Vertex{X: 1} Y
阅读全文
摘要:go mod init [module path] This command creates a new go.mod file in the current directory. It means a new module is rooted at the current directory. g
阅读全文
摘要:Golang manages dependencies by modules. A module is a collection of packages. Modules can be downloaded from version control repositories or from modu
阅读全文

浙公网安备 33010602011771号