package component var _ Component = (*Base)(nil) // Base 空组件,实现组件时,优先嵌入此基类,然后根据基类方法进行重写 // 可方便实现Component,无需每个Component都要实现两个方法 type Base struct{} func (*Base) OnInit() { } func (*Base) OnShutdown() { }