golang继承与多态 golang继承与多态
golang中的继承 package main import "log" type Person struct { Name string Age int } type Student struct { Per
2023-02-15
golang断言与类型判断 golang断言与类型判断
golang断言 一个interface 需要类型转换的时候,语法 i.(T) v,ok:=i.(T) ,ok=true代表断言成功,ok=false v是这个类型的0值 package main import "fmt" func
2022-07-08
golang继承多态 golang继承多态
package main import "fmt" type Person struct { //爹 id int name string age int } // 定义结构体类型 (子类) typ
2022-07-08