From d2a050bd8fdb42865286c364a34a35b40ef5c128 Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Tue, 15 Oct 2024 16:07:41 +0200 Subject: [PATCH] Create NewPersion function --- person.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/person.go b/person.go index bf947bd..431a4c7 100644 --- a/person.go +++ b/person.go @@ -13,6 +13,10 @@ type Person struct { Extensions []*ExtensionElement `xml:",any,omitempty"` } +func NewPerson(name string) *Person { + return &Person{Name: name} +} + func (p *Person) Check() error { if p.Name == "" { return errors.New("name element of person element empty")