
在您的问题中,您没有提及
B。我猜您需要将其属性编组为
A.Name?如果是这样-您可以将A结构更改为以下形式:
type A struct { Id string `xml:"id,attr"` // A_ID Name struct { Id string `xml:"id,attr"` // B_ID } `xml:"B"`}甚至更好-定义单独的B结构:
type A struct { Id string `xml:"id,attr"` // A_ID Name B `xml:"B"`}type B struct { Id string `xml:"id,attr"` // B_ID}欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)