摘要:
点击查看代码 package main import "fmt" func test(a interface{}){ fmt.Printf("你好啊%#v==%v==%T==%p\n",a,a,a,&a) // 将接口类型的变量转化为具体类型 加个OK 判断, 可以避免程序直接崩溃, ok=fals 阅读全文
posted @ 2022-03-07 23:22
ty1539
阅读(36)
评论(0)
推荐(0)
摘要:
点击查看代码 package main import "fmt" type Animal interface{ Talk() Eat() Name() string } type Dog struct{} func (d Dog) Talk(){ fmt.Println("汪汪汪") } func 阅读全文
posted @ 2022-03-07 23:09
ty1539
阅读(30)
评论(0)
推荐(0)
摘要:
点击查看代码 package main import "fmt" type Animal interface{ Talk() Eat() Name() string //string 是方法返回的类型 } type Describle interface{ Describle() } type Av 阅读全文
posted @ 2022-03-07 22:08
ty1539
阅读(31)
评论(0)
推荐(0)
摘要:
https://github.com/markusleevip/go-shici https://github.com/joizhang/learn-golang 阅读全文
posted @ 2022-03-07 21:41
ty1539
阅读(46)
评论(0)
推荐(0)

浙公网安备 33010602011771号