Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
chanxuehong committed Dec 7, 2015
1 parent 2481f13 commit bdf3db0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ var _ xml.Marshaler = H(nil)

// MarshalXML implements xml.Marshaler
func (h H) MarshalXML(e *xml.Encoder, start xml.StartElement) (err error) {
if start.Name.Local == "H" { // type name
start.Name.Space = ""
start.Name.Local = "map"
start.Attr = nil
}
if err = e.EncodeToken(start); err != nil {
return
}
for key, value := range h {
if key == "" {
continue
}
elem := xml.StartElement{
Name: xml.Name{Space: "", Local: key},
}
Expand Down

0 comments on commit bdf3db0

Please sign in to comment.