From 5de5949de8d70d54045859cc3ada9cffd8c6c05d Mon Sep 17 00:00:00 2001 From: WindowsSov8forUs Date: Wed, 19 Jun 2024 13:57:16 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0=E5=AD=90=E5=85=83?= =?UTF-8?q?=E7=B4=A0=E4=B8=8E=E6=89=A9=E5=B1=95=E5=B1=9E=E6=80=A7=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E8=AE=BE=E7=BD=AE=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/message/message_element.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/message/message_element.go b/pkg/message/message_element.go index e3b0bfc..e65ae7f 100644 --- a/pkg/message/message_element.go +++ b/pkg/message/message_element.go @@ -57,6 +57,11 @@ func (e *ChildrenMessageElement) GetChildren() []MessageElement { return e.children } +func (e *ChildrenMessageElement) SetChildren(children []MessageElement) *ChildrenMessageElement { + e.children = children + return e +} + type ExtendAttributes struct { attributes map[string]string } @@ -72,6 +77,14 @@ func (e *ExtendAttributes) AddAttribute(key, value string) *ExtendAttributes { return result } +func (e *ExtendAttributes) DelAttribute(key string) *ExtendAttributes { + if e == nil { + return nil + } + delete(e.attributes, key) + return e +} + func (e *ExtendAttributes) Get(key string) (string, bool) { if e == nil { return "", false