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: document thread safety #6985

gopherbot opened this issue Dec 19, 2013 · 5 comments

text/template: document thread safety #6985

gopherbot opened this issue Dec 19, 2013 · 5 comments


Copy link

@gopherbot gopherbot commented Dec 19, 2013

by infogulch:

None of the template modules specify whether they are thread-safe.

Specifically, neither text/template nor html/template contain the word
"thread" at all:

Since net/http spawns separate goroutines for each connection and html/template is so
commonly used with it (see various official tutorials), I believe it is highly likely
that html/template is, in fact, thread safe. However, the usual assumption is that a
module is not thread safe unless specifically indicated otherwise.

They should specify if they are thread-safe or not, and which operations are thread safe
if not all.
Copy link

@adg adg commented Dec 19, 2013

Comment 1:

The docs should state that at least Execute is thread safe.

Labels changed: added release-go1.3, repo-main.

Status changed to Accepted.

Copy link

@dsymonds dsymonds commented Jan 2, 2014

Comment 2:

Labels changed: added documentation, size-s.

Owner changed to @robpike.

Copy link

@robpike robpike commented Apr 10, 2014

Comment 3:

It's already documented:
// Once constructed, a template may be executed safely in parallel.
but I'll say it in more places.
Copy link

@gopherbot gopherbot commented Apr 10, 2014

Comment 4:

CL mentions this issue.
Copy link

@robpike robpike commented Apr 15, 2014

Comment 5:

This issue was closed by revision aeb3752.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@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.
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.