Golang encoding/xml.Comment type example
package encoding/xml
A Comment represents an XML comment of the form . The bytes do not include the comment markers.
Golang encoding/xml.Comment type example
...
switch t := t.(type) {
case CharData:
EscapeText(p, t)
case Comment: // <--- here
if bytes.Contains(t, endComment) {
return fmt.Errorf("xml: EncodeToken of Comment containing --> marker")
}
p.WriteString("<!--")
p.Write(t)
p.WriteString("-->")
...
Reference :
Advertisement
Something interesting
Tutorials
+8.2k Android Studio : Rating bar example
+4.6k MariaDB/MySQL : How to get version information
+6.5k Golang : Spell checking with ispell example
+18.6k Golang : Get download file size
+6k Golang : How to verify input is rune?
+40.1k Golang : UDP client server read write example
+14.3k Golang : Simple word wrap or line breaking example
+5.1k Swift : Convert (cast) Float to Int or Int32 value
+17.8k Golang : Defer function inside init()
+7.1k Golang : Get Alexa ranking data example
+6.4k PHP : Proper way to get UTF-8 character or string length
+6.9k Golang : Calculate BMI and risk category