package mainimport ("fmt")type people struct{name stringage uintsex bool}type Ipeople interface{get() peopleshow_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)是什么意思??接口调用匿名函数?大佬求教!
- 1 回答
- 0 关注
- 322 浏览
添加回答
举报
0/150
提交
取消