Skip to content
Myr

Using keyed initialization to fix app-engine integration

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Manu Mtz-Almeida · committed by Manu Mtz-Almeida · parent f63a354 · Browse files · 1 file+7 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−4 removed

  • other:+7 added−4 removed

1 file+7 added−4 removed

modified:gin.go+7 added-4 removed
78 unmodified lines
79)8081// Allows type H to be used with xml.Marshal82func (h H) MarshalXML(e *xml.Encoder, start xml.StartElement) error {83 start.Name = xml.Name{"", "map"}83 start.Name = xml.Name{84 Space: "",85 Local: "map",86 }87 if err := e.EncodeToken(start); err != nil {88 return err89 }90 for key, value := range h {91 elem := xml.StartElement{89 xml.Name{"", key},90 []xml.Attr{},92 Name: xml.Name{Space: "", Local: key},93 Attr: []xml.Attr{},94 }95 if err := e.EncodeElement(value, elem); err != nil {96 return err97 }98 }96 if err := e.EncodeToken(xml.EndElement{start.Name}); err != nil {99 if err := e.EncodeToken(xml.EndElement{Name: start.Name}); err != nil {100 return err101 }102 return nil103}
404 unmodified lines