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

text/template: does not document how values are formatted #16105

rogpeppe opened this issue Jun 18, 2016 · 2 comments

text/template: does not document how values are formatted #16105

rogpeppe opened this issue Jun 18, 2016 · 2 comments


Copy link

@rogpeppe rogpeppe commented Jun 18, 2016

go version devel +3c6b668 Thu Jun 2 00:22:03 2016 +0000 linux/amd64

I may well have missed it, but text/template package doesn't seem to specify
anywhere how values are actually displayed. For example, by reading the
documentation, it's not clear whether a value's String method will be called
to produce text to display in the template.

Copy link

@cespare cespare commented Jun 18, 2016

I agree; the closest thing in the documentation currently is

The default textual representation of the value of the pipeline is copied to the output.

The "default" it refers to is (AFAICT) the same "default format" that the fmt package documentation refers to. Perhaps the fix is simply to say that values are formatted as if using the %v verb.

/cc @robpike @adg

@adg adg added the NeedsFix label Jun 20, 2016
@adg adg added this to the Go1.7Maybe milestone Jun 20, 2016
@adg adg self-assigned this Jun 20, 2016
Copy link

@gopherbot gopherbot commented Jun 20, 2016

CL mentions this issue.

@gopherbot gopherbot closed this in 86b0310 Jun 21, 2016
@golang golang locked and limited conversation to collaborators Jun 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.