diff --git a/gin.go b/gin.go index 020b66d..70108df 100644 --- a/gin.go +++ b/gin.go @@ -80,20 +80,23 @@ type ( // Allows type H to be used with xml.Marshal func (h H) MarshalXML(e *xml.Encoder, start xml.StartElement) error { - start.Name = xml.Name{"", "map"} + start.Name = xml.Name{ + Space: "", + Local: "map", + } if err := e.EncodeToken(start); err != nil { return err } for key, value := range h { elem := xml.StartElement{ - xml.Name{"", key}, - []xml.Attr{}, + Name: xml.Name{Space: "", Local: key}, + Attr: []xml.Attr{}, } if err := e.EncodeElement(value, elem); err != nil { return err } } - if err := e.EncodeToken(xml.EndElement{start.Name}); err != nil { + if err := e.EncodeToken(xml.EndElement{Name: start.Name}); err != nil { return err } return nil