From ac78db99171e8c2d655ed619ed57031e9de7e6cd Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Tue, 15 Oct 2024 17:26:59 +0200 Subject: [PATCH] Add function to create a new extension element --- extensionElement.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensionElement.go b/extensionElement.go index faeaafb..de17c5d 100644 --- a/extensionElement.go +++ b/extensionElement.go @@ -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")