package main
type Parent struct {
}
func (self *Parent) Run() {
self.Test()
}
func (self *Parent) Test() {
println("parent")
}
type Child struct {
Parent
}
func (self *Child) Test() {
println("child")
}
func main() {
parent := Parent{}
parent.Run()
child := Child{}
child.Run()
}
请教一下有什么好的方法可以child调用自己的Test呢?
Run是一个公共函数,不想写多次