I have an interface:
package pkg
type BaseInterface interface {
func Nifty() bool
func Other1()
func Other2()
...
func Other34123()
}
and a struct that implements it:
package pkg
type Impl struct {}
func (Impl) Nifty() bool { ... }
Then along comes another struct which wants to embed the first and do it's own Nifty():
package myOtherPackage
import "pkg"
type ImplToo struct {
*pkg.Impl
}
func (it ImplToo) Nifty() bool { ... something else ... }
This is sort of like class inheretance with method override in an OOP language. I want to know how to do the equivalent of implToo.super().Nifty() - that is, from the ImplToo Nifty() implementation, call the pkg.Impl Nifty() implementation.
What is the proper conversion to use on it
so that I can accomplish this? Everything I try yields either unbounded recursion on ImplToo's Nifty(), or some compiler error such as:
invalid type assertion: (&it).(BaseInterface) (non-interface type *it on left)
... or many variations on that.