swig/Examples/go/extend/ceo.go
Michael Schaller 85037c3a33 [Go] Updated the 'callback' and 'extend' examples to match the 'director' one.
After the documentation update on how to utilize the director feature with
commit @17b1c1c the 'callback' and 'extend' examples needed an update as well.
2015-08-09 14:37:16 +02:00

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"
}