2020年11月25日

go接口使用案例晓demo

摘要: 1.go里面接口必须使用interface 这个案例也体现了多台特性 package main import "fmt" type Usb interface { work() finish() } type Phone struct { } func ( phone Phone) work(){ 阅读全文

posted @ 2020-11-25 22:57 孤灯引路人 阅读(228) 评论(0) 推荐(0) 编辑

go面向对象-继承

摘要: 代码实例 package main import "fmt" type Persion struct { Name string Age int32 } func (p * Persion) talk(){ fmt.Printf("我是一个人"); } func (p * Persion) Eat( 阅读全文

posted @ 2020-11-25 00:19 孤灯引路人 阅读(48) 评论(0) 推荐(0) 编辑

导航