我正在尝试在 golang 中实现继承。下面是例子:
type A struct {
Number int
}
type B struct{
A
name String
}
func (a A) GetNumber() {
// Here I want to use instance of B
fmt.Println(a) // but this is giving me instance of A
}
如果 A 被 B 继承,是否可以在 A 的函数中获取 B 的实例?