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
+19.2k Golang : Read input from console line
+42.3k Golang : How do I convert int to uint8?
+8k Golang : Scan files for certain pattern and rename part of the files
+17k Golang : Gzip file example
+18.3k Golang : Get all upper case or lower case characters from string example
+13.8k Facebook PHP getUser() returns 0
+6.3k Golang : Convert Chinese UTF8 characters to Pin Yin
+34.3k Golang : Proper way to set function argument default value
+6.5k Golang : Extract sub-strings
+9.7k Golang : Play .WAV file from command line
+6.7k PHP : Shuffle to display different content or advertisement
+12.7k Elastic Search : Return all records (higher than default 10)