Skip to content

text/template: document thread safety #6985

@gopherbot

Description

@gopherbot

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:
http://golang.org/pkg/text/template/
http://golang.org/pkg/html/template/

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions