Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html/template: HTML type example is confusing #9651

Closed
ssilva opened this issue Jan 21, 2015 · 1 comment
Closed

html/template: HTML type example is confusing #9651

ssilva opened this issue Jan 21, 2015 · 1 comment

Comments

@ssilva
Copy link

ssilva commented Jan 21, 2015

The html/template documentation has a snippet of code showing the usage of the HTML type. It does not use the "template" package name to scope it:

tmpl.Execute(out, HTML(`<b>World</b>`))

This code will throw an "undefined: HTML" error.

Instead, it should be like so:

tmpl.Execute(out, template.HTML(`<b>World</b>`))
@adg adg changed the title docs: html/template HTML type example is confusing html/template HTML type example is confusing Jan 21, 2015
@adg adg self-assigned this Jan 21, 2015
@adg
Copy link
Contributor

adg commented Jan 21, 2015

@adg adg closed this as completed in 746dec5 Jan 21, 2015
@mikioh mikioh changed the title html/template HTML type example is confusing html/template: HTML type example is confusing Jan 21, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
@rsc rsc unassigned adg Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants