【发布时间】:2015-04-14 15:14:45
【问题描述】:
我可以在 golang 中嵌入指针和值。 通过指针
type Bitmap struct{
data [4][4]bool
}
type Renderer struct{
*Bitmap
on uint8
off uint8
}
按价值
type Bitmap struct{
data [4][4]bool
}
type Renderer struct{
Bitmap
on uint8
off uint8
}
指针和值更喜欢什么?
【问题讨论】:
-
引用您的资料来源可能是个好主意:hydrogen18.com/blog/golang-embedding.html
标签: go