I have package A and B that is defined under A
package A
package B
It's like package image
and package image/png
In package A, I define the following:
// Space is a space for drawing.
type Space struct {
image.RGBA
}
Then I create a sub-package called B with the following import lines.
import (
)
And want to use in that sub-package B, like the following.
func (s A.Space) Draw() {
return ....
}
This does not work. So I tried the following:
type Space interface {
A.Space
}
func (s Space) Draw() {
return ....
}
And get the message: interface contains embedded non-interface
Is there any other way that I can use parental-package as sub-package receiver? Or is there anyway that I can just make the sub-package inherit everything from the parental package?
Thanks!