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
+7k Golang : Levenshtein distance example
+14.4k Golang : Parsing or breaking down URL
+7.5k Golang : Process json data with Jason package
+9.8k Golang : Get current, epoch time and display by year, month and day
+19.9k Golang : Accept input from user with fmt.Scanf skipped white spaces and how to fix it
+3.6k Java : Get FX sentiment from website example
+4.9k Javascript : How to get width and height of a div?
+12.2k Golang : Simple client-server HMAC authentication without SSL example
+5.3k Golang : How to deal with configuration data?
+12.8k Golang : http.Get example
+47.8k Golang : Convert int to byte array([]byte)
+17.3k Golang : How to tell if a file is compressed either gzip or zip ?