Je pense utiliser le inline La balise de champ est la meilleure option pour vous. La documentation mgo/v2/bson indique :
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.
Votre structure doit alors être définie comme suit :
type Cube struct {
Square `bson:",inline"`
Depth int
}
Modifier
inline existe aussi dans mgo/v1/bson au cas où vous l'utiliseriez.