Jeg tror, at du bruger inline
field tag er den bedste mulighed for dig. Mgo/v2/bson-dokumentationen siger:
inline Inline the field, which must be a struct or a map,
causing all of its fields or keys to be processed as if
they were part of the outer struct. For maps, keys must
not conflict with the bson keys of other struct fields.
Din struktur skal derefter defineres som følger:
type Cube struct {
Square `bson:",inline"`
Depth int
}
Rediger
inline
findes også i mgo/v1/bson
hvis du bruger den.