How to escape the html using golang?
package main
import (
"fmt"
"html"
)
func main() {
var s string = `"<script>alert(123);</script>"`
fmt.Println(html.EscapeString(s))
}
There's EscapeString function in html package
unescaped := `<script>alert(123);</script>`
escaped := html.EscapeString(unescaped)