Standard library / html/template

html/template.HTMLEscaper()

Formats arguments and escapes the result for HTML. Expected stdout: '<b>\n'.

Formal Syntax & Structure

go syntaxgo
func HTMLEscaper(args ...any) string

Parameters & Attributes

NameTypeDescription
args...anyValues formatted before escaping.

Return Value

string

Formats arguments and escapes the result for HTML.

Working Example

Example Snippetgo
package main
import (  "fmt"  "html/template")
func main() { fmt.Println(template.HTMLEscaper("<", "b>")) }
Go Reference