fix: omitempty is not compatible with chardata xml encoding tag

This commit is contained in:
Derek Brown 2021-01-15 17:14:34 -05:00
parent 1f2f2bb1c5
commit da90222053

View File

@ -12,7 +12,7 @@ import (
type Subject struct { type Subject struct {
XMLName xml.Name `xml:"subject"` XMLName xml.Name `xml:"subject"`
Content string `xml:",chardata,omitempty"` Content string `xml:",chardata"`
Lang string `xml:"lang,attr,omitempty"` Lang string `xml:"lang,attr,omitempty"`
} }
@ -20,7 +20,7 @@ type Subject struct {
type Body struct { type Body struct {
XMLName xml.Name `xml:"body"` XMLName xml.Name `xml:"body"`
Content string `xml:",chardata,omitempty"` Content string `xml:",chardata"`
Lang string `xml:"lang,attr,omitempty"` Lang string `xml:"lang,attr,omitempty"`
} }