是否可以在没有对象初始化器的情况下继承?
type BaseEmployee struct{
LastName string
}
type Employee struct {
Name string,
BaseEmployee
}
现在我有这个:
ob := Employee {
FirstName: "Ron"
LastName : BaseEmployee {LastName : "Howard"}
}
但是我想实现这样的目标:
ob := Employee {
FirstName: "Ron"
LastName : "Howard",//<<<<<<<<<---- how us that possible?
}
可能的?
慕田峪4524236
相关分类