Add function to create a new extension element

This commit is contained in:
Jason Streifling 2024-10-15 17:26:59 +02:00
parent 9ec6ad1460
commit ac78db9917

View File

@ -10,6 +10,10 @@ type ExtensionElement struct {
XMLName xml.Name
}
func NewExtensionElement(name string, value any) *ExtensionElement {
return &ExtensionElement{XMLName: xml.Name{Local: name}, Value: value}
}
func (e *ExtensionElement) Check() error {
if e.Value == nil {
return errors.New("value element of extension element empty")