diff --git a/person.go b/person.go index 431a4c7..99d9dd3 100644 --- a/person.go +++ b/person.go @@ -1,6 +1,7 @@ package atomfeed import ( + "encoding/xml" "errors" "fmt" ) @@ -17,6 +18,10 @@ func NewPerson(name string) *Person { return &Person{Name: name} } +func (p *Person) AddExtension(name string, value any) { + p.Extensions = append(p.Extensions, &ExtensionElement{XMLName: xml.Name{Local: name}, Value: value}) +} + func (p *Person) Check() error { if p.Name == "" { return errors.New("name element of person element empty")