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: not documented that the $ is root variable. #13592

Closed
kybin opened this issue Dec 12, 2015 · 2 comments
Closed

text/template: not documented that the $ is root variable. #13592

kybin opened this issue Dec 12, 2015 · 2 comments

Comments

@kybin
Copy link
Contributor

@kybin kybin commented Dec 12, 2015

Inside of {{range (root).A}} loop, I wanted use (root).B. But intead it refers (root).A.B.

I noticed it's expected behavior, but I couldn't find what is the root variable in the document of text/template but found in stackoverflow.

I think we need explanation of what is root variable in the standard document of text/template.

@ianlancetaylor ianlancetaylor added this to the Go1.6Maybe milestone Dec 12, 2015
@ghost
Copy link

@ghost ghost commented Dec 13, 2015

The variable $ is documented in the section on variables:

When execution begins, $ is set to the data argument passed to Execute, that is, to the starting value of dot.

@kybin
Copy link
Contributor Author

@kybin kybin commented Dec 13, 2015

Ah, I didn't catch that..

I still think it's needs more clarification. (for non-english users?) But that purely depends on go-team's decision.

Thank you for letting me know. @lstokeworth

@bradfitz bradfitz closed this Dec 13, 2015
@golang golang locked and limited conversation to collaborators Dec 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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