package main
import ("fmt")
type people struct{
name string
age uint
sex bool
}
type Ipeople interface{
get() people
show_name()
show_age()
show_sex()
}
func(this people)show_name(){
fmt.Println(this.name)
}
func(this people)show_age(){
fmt.Println(this.age)
}
func(this people)show_sex(){
fmt.Println(this.sex)
}
func(this people)get() people{
return this
}
func main(){
var interf Ipeople = people{"asdf",18,true}
interf.show_name()
fmt.Println(interf.(people))
}
这最后一句中的interf.(people)是什么意思??
接口调用匿名函数?大佬求教!
炎炎设计