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.8k Golang : Launching your executable inside a console under Linux
+10.3k Golang : Detect number of faces or vehicles in a photo
+5.6k Unix/Linux : How to find out the hard disk size?
+11k Golang : Generate random elements without repetition or duplicate
+11.8k Golang : Verify Linux user password again before executing a program example
+41k Golang : How to check if a string contains another sub-string?
+23.5k Golang : Read a file into an array or slice example
+6.3k Golang : How to get capacity of a slice or array?
+29.2k Golang : missing Git command
+5.6k Swift : Get substring with rangeOfString() function example
+7.5k Golang : Detect sample rate, channels or latency with PortAudio
+30.4k Golang : How to redirect to new page with net/http?