Standard library / text/template
text/template.HTMLEscaper()
Formats arguments and escapes the result for HTML. Expected stdout: '<b>\n'.
Formal Syntax & Structure
go syntaxgo
func HTMLEscaper(args ...any) stringParameters & Attributes
| Name | Type | Description |
|---|---|---|
| args | ...any | Values formatted before escaping. |
Return Value
string
Formats arguments and escapes the result for HTML.
Working Example
Example Snippetgo
package main
import ( "fmt" "text/template")
func main() { fmt.Println(template.HTMLEscaper("<", "b>")) }