【发布时间】:2018-09-17 10:33:56
【问题描述】:
我在挖掘 AWS SDK 源代码时发现了以下类型声明:
type Condition struct {
_ struct{} `type:"structure"`
// the rest of code is removed
}
有人知道这种嵌入的目的/解释吗?
【问题讨论】:
-
除其他用途外,还可以使用下划线的空结构字段(并且是在一些地方被标准库使用)作为@987654321的零大小方法@.
标签: go