From 94bc35bb2db753c4af7b43595569938a84d8f57e Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Sun, 13 Jul 2014 16:53:46 +0200 Subject: [PATCH] Using keyed initialization to fix app-engine integration --- gin.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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