template.HTMLAttr with User Data
template.HTMLAttr marks strings as trusted, bypassing auto-escaping; formatted or concatenated strings can include untrusted input used as attribute values.
Preview example – GO
// Dangerous: HTMLAttr with user input
userClass := r.URL.Query().Get("class")
attr := template.HTMLAttr(fmt.Sprintf("class='%s'", userClass))