1
Это мой XML данные:Golang XML разбора
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/generic.qcow2'/>
<backingStore/>
<target dev='hda' bus='ide'/>
<alias name='ide0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
и моя структура является:
// struct for get device details from xml
type DiskXmlInfo struct {
Devices []Disk `xml:"devices>disk"`
}
type Disk struct {
Type string `xml:"device,attr"`
// Name string `xml:"target>dev,attr"`
Name string `xml:"target>dev,attr"`
}
Я не могу получить имя целевого атрибута. Как получить имя целевого атрибута?
Заранее спасибо.