From 8b8d3c3384d005a4033fc07eb63deb6a5d0be86f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Mon, 4 Nov 2024 17:13:43 +0800 Subject: [PATCH] update xml serialize --- xml.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xml.go b/xml.go index 92db2f1..c1b618d 100644 --- a/xml.go +++ b/xml.go @@ -72,7 +72,7 @@ type AnyMap map[string]any type xmlMapEntry struct { XMLName xml.Name - Value string `xml:",chardata"` + Value any `xml:",chardata"` } func (m *AnyMap) MarshalXML(e *xml.Encoder, start xml.StartElement) error { @@ -88,7 +88,7 @@ func (m *AnyMap) MarshalXML(e *xml.Encoder, start xml.StartElement) error { return err } - for k, v := range m { + for k, v := range *m { _ = e.Encode(xmlMapEntry{XMLName: xml.Name{Local: k}, Value: v}) }