Golang text/template.HTMLEscaper() function example
package text/template
Golang text/template.HTMLEscaper() function usage example
package main
import (
"fmt"
"html/template"
)
func main() {
a := "<script>alert('xss attack!')</script>"
b := "<p>This is a paragraph</p>"
final := template.HTMLEscaper(a, b)
fmt.Println(final)
}
Reference :
Advertisement
Something interesting
Tutorials
+18.9k Golang : Read input from console line
+12k Golang : Clean formatting/indenting or pretty print JSON result
+12.7k Golang : zlib compress file example
+7.1k Golang : Array mapping with Interface
+9.5k Mac OSX : Get a process/daemon status information
+17.9k Golang : Login and logout a user after password verification and redirect example
+30.4k Golang : How to verify uploaded file is image or allowed file types
+32.2k Golang : Convert []string to []byte examples
+6.5k Golang : Spell checking with ispell example
+9.8k Golang : Get current, epoch time and display by year, month and day
+8.3k Golang : Number guessing game with user input verification example