草庐IT

AnotherStruct

全部标签

go - 如何在结构中打印结构 slice 的标记

我有结构配置,它由字段SliceOfAnotherStruct组成,其中包含指向的指针的sliceAnotherStruct.这里如何获取AnotherStruct中Bank字段的json标签。typeConfigstruct{SliceOfAnotherStruct[]*AnotherStruct`bson:"anotherStruct"json:"anotherStruct"validate:"required,dive,required"`}typeAnotherStructstruct{Namestring`bson:"name"json:"name"validate:"req