Make extensions omitempty

This commit is contained in:
Jason Streifling 2024-10-13 20:42:17 +02:00
parent 92c794d070
commit 83962a0341
4 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@ type Entry struct {
Summary *Text `xml:"summary,omitempty"`
Title *Text `xml:"title"`
Updated *Date `xml:"updated"`
Extensions []*ExtensionElement `xml:",any"`
Extensions []*ExtensionElement `xml:",any,omitempty"`
}
func (e *Entry) checkAuthors() error {

View File

@ -21,7 +21,7 @@ type Feed struct {
Subtitle *Text `xml:"subtitle,omitempty"`
Title *Text `xml:"title"`
Updated *Date `xml:"updated"`
Extensions []*ExtensionElement `xml:",any"`
Extensions []*ExtensionElement `xml:",any,omitempty"`
Entries []*Entry `xml:"entry,omitempty"`
}

View File

@ -10,7 +10,7 @@ type Person struct {
Name string `xml:"name"`
URI URI `xml:"uri,omitempty"`
Email EmailAddress `xml:"email,omitempty"`
Extensions []*ExtensionElement `xml:",any"`
Extensions []*ExtensionElement `xml:",any,omitempty"`
}
func (p *Person) Check() error {

View File

@ -16,7 +16,7 @@ type Source struct {
Subtitle *Text `xml:"subtitle,omitempty"`
Title *Text `xml:"title,omitempty"`
Updated *Date `xml:"updated,omitempty"`
Extensions []*ExtensionElement `xml:",any"`
Extensions []*ExtensionElement `xml:",any,omitempty"`
}
func (s *Source) Check() error {