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
+5.6k Javascript : How to refresh page with JQuery ?
+18.6k Golang : Find IP address from string
+25.7k Golang : How to write CSV data to file
+11.6k SSL : The certificate is not trusted because no issuer chain was provided
+6k PHP : How to check if an array is empty ?
+7.8k Golang : Example of how to detect which type of script a word belongs to
+24k Golang : Call function from another package
+6.5k Grep : How to grep for strings inside binary data
+37.7k Golang : Comparing date or timestamp
+20.7k Android Studio : AlertDialog and EditText to get user string input example
+14k Golang : Compress and decompress file with compress/flate example