摘要: 同一个目录下, package包名需要相同,通常都有父级目录文件名为包名 package Gotest 导入包 import ( "fmt" "其他..." ) 别名 import ( "fmt" // 别名 "包所在位置" a "Go/a" // 全部导入(少用) . "Go/a" // 匿名 _ 阅读全文
posted @ 2023-03-14 14:32 ForLivetoLearn 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 当前结构体方法只要将接口上定义的方法全部实现,通过该结构体实例化后的实例就可以当为接口实例 type person interface { walk() talk() smile() } type student struct { name string } func (s student) tal 阅读全文
posted @ 2023-03-14 13:08 ForLivetoLearn 阅读(11) 评论(0) 推荐(0) 编辑