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