After the documentation update on how to utilize the director feature with
commit @17b1c1c the 'callback' and 'extend' examples needed an update as well.
37 lines
499 B
Go
37 lines
499 B
Go
package example
|
|
|
|
type CEO interface {
|
|
Manager
|
|
deleteManager()
|
|
IsCEO()
|
|
}
|
|
|
|
type ceo struct {
|
|
Manager
|
|
}
|
|
|
|
func (p *ceo) deleteManager() {
|
|
DeleteDirectorManager(p.Manager)
|
|
}
|
|
|
|
func (p *ceo) IsCEO() {}
|
|
|
|
type overwrittenMethodsOnManager struct {
|
|
p Manager
|
|
}
|
|
|
|
func NewCEO(name string) CEO {
|
|
om := &overwrittenMethodsOnManager{}
|
|
p := NewDirectorManager(om, name)
|
|
om.p = p
|
|
|
|
return &ceo{Manager: p}
|
|
}
|
|
|
|
func DeleteCEO(p CEO) {
|
|
p.deleteManager()
|
|
}
|
|
|
|
func (p *ceo) GetPosition() string {
|
|
return "CEO"
|
|
}
|