我尝试扩展基本结构,如下所示:
import (
"fmt"
)
type A struct {
A bool
C bool
}
type B struct {
A
B bool
}
func main() {
fmt.Println("Hello,playground")
a := A{
A: false,C: false,}
b := B{
a,true,}
fmt.Print(b)
}
但是它创建了继承结构。这段代码的输出是:{{false false} true}
但我想得到 {false false true}
有可能吗?