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: (also html/template?) range on channel gotcha #7986

Closed
gopherbot opened this issue May 13, 2014 · 2 comments
Closed

text/template: (also html/template?) range on channel gotcha #7986

gopherbot opened this issue May 13, 2014 · 2 comments

Comments

@gopherbot
Copy link

by krolaw:

This relate's in part to issue #7445.

Currently Execute is documented as:
Execute applies a parsed template to the specified data object, and writes the output to
wr.

I believe it should say that if a write error is encountered, the remainder of the
template will not be executed.

I discovered this behaviour when serving templates over http, ranging over a channel,
which was populated by a goroutine.  If the network connection prematurely closed, the
goroutine would lock up/memory leak.

This might also be worth a mention with the range command when dealing with channels.
@rsc
Copy link
Contributor

rsc commented May 21, 2014

Comment 1:

Execute applies a parsed template to the specified data object, and
    writes the output to wr. If an error occurs executing the template or
    writing its output, ***execution stops***...
We can't enumerate every possible meaning of stop.

Status changed to WorkingAsIntended.

@gopherbot
Copy link
Author

Comment 2 by krolaw:

That second sentence was added by https://golang.org/cl/94640043 (closing issue
7445) 45 hours ago, long after this bug was filed.  But happy to see the sentence there,
so yes it now is working as intended :-)

@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
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

2 participants