Parcourir la source

fix: 添加 CDATA.MarshalXML 注释

陈灿鑫 il y a 6 ans
Parent
commit
1475417a64
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      message/message.go

+ 1 - 0
message/message.go

@@ -187,6 +187,7 @@ type CommonToken struct {
 // CDATA  使用该类型,在序列化为 xml 文本时文本会被解析器忽略
 type CDATA string
 
+//  MarshalXML 实现自己的序列化方法
 func (c CDATA) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
 	return e.EncodeElement(struct {
 		string `xml:",cdata"`