摘要: 1. 指针 指针类型,指针的值: * 指针引用,指针位置: & type person struct { name string } func changeStrValue(p *person) { p.name = "new" } func main() { p := person{name: " 阅读全文
posted @ 2023-03-13 16:32 ForLivetoLearn 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 1. type关键字 定义类型别名 type myInt = int var a myInt = 1 var b int = 2 fmt.Println(a + b) 类型定义 定义接口 定义结构体 类型判断 2. 结构体 定义结构体 type person struct { name string 阅读全文
posted @ 2023-03-13 15:48 ForLivetoLearn 阅读(7) 评论(0) 推荐(0) 编辑