1.接口多态
package main import "fmt" type Humon interface { syHi() } type Person struct { } type Student struct{ } func (p *Person) sayHi(){ fmt.Println("this is persion"); } func ( stu *Student) sayHi(){ fmt.Printf("this is student"); } func main(){ humn:=Person{}; humn.sayHi(); }