接口
接口是用来定义行为的类型。这些被定义的行为不由接口直接实现,而是通过方法由用户 定义的类型实现。如果用户定义的类型实现了某个接口类型声明的一组方法,那么这个用户定 义的类型的值就可以赋给这个接口类型的值
package main
import fmt
type notifier interface {
notify()
}
type student struct {
name string
email string
}
func main(){
stu1 := student{cdb, [email protected]}
sendNotify(&stu1)
//sendN