I am using golang to change the xml node dynamically? some struct is as the following:
type Row struct {
XMLName xml.Name `xml:"row"`
R string `xml:"r,attr,omitempty"`
}
after xml.Marshal(), it output maybe "<row r="123"></row>"
but i want to change the "<row></row>"
to "<myrow></myrow>"
if some condition is true.
how to dynamically change the xml node using golang?