package main import ( "fmt" "html" ) func main() { unescaped := `<script>alert(123);</script>` escaped := html.EscapeString(unescaped) fmt.Println(escaped) }