Golang encoding/xml.Escape() function example
package encoding/xml
Escape is like EscapeText but omits the error return value. It is provided for backwards compatibility with Go 1.0. Code targeting Go 1.1 or later should use EscapeText.
Golang encoding/xml.Escape() function usage example
package main
import (
"encoding/xml"
"os"
)
func main() {
str := "\"'&<>"
xml.Escape(os.Stdout, []byte(str))
}
Output :
" '&<>
Reference :
Advertisement
Something interesting
Tutorials
+12k Golang : Secure file deletion with wipe example
+11.8k Get form post value in Go
+5.7k Clean up Visual Studio For Mac installation failed disk full problem
+12.7k Elastic Search : Return all records (higher than default 10)
+9.9k Golang : Copy map(hash table) example
+6.4k Golang : Scan forex opportunities by Bollinger bands
+17.8k Golang : Find smallest number in array
+23.8k Golang : Get ASCII code from a key press(cross-platform) example
+8.1k Golang : Lock executable to a specific machine with unique hash of the machine
+9.2k Golang : Accept any number of function arguments with three dots(...)
+23.3k Golang : Calculate time different
+19k Golang : convert int to string