]> Cypherpunks repositories - gostls13.git/commit
template: warn about interleaved nature of writes
authorDieter Plaetinck <dieter@raintank.io>
Fri, 10 Feb 2017 10:54:58 +0000 (11:54 +0100)
committerRob Pike <r@golang.org>
Fri, 5 May 2017 17:58:56 +0000 (17:58 +0000)
commit1acff5fe61013d4f5b1ed6602654abbbe73b1599
tree69a7be051101476d76c12cfacc023bf6eb14cad3
parent27a10f7da791602cc6d059d3164052aa397d6ef3
template: warn about interleaved nature of writes

Execute incurs separate writes for each "step", e.g. each
variable that needs to be printed, and the final newline.
While it is correct to state that templates can be executed
concurrently, there is a more subtle nuance that is easily missed:
when writing to the same writer, the writes from concurrent execute
calls can be interleaved, leading to unexpected output.

Change-Id: I0abbd7960d8a8d15e109a8a3eeff3b43b852bbbf
Reviewed-on: https://go-review.googlesource.com/37444
Reviewed-by: Rob Pike <r@golang.org>
src/html/template/template.go
src/text/template/doc.go
src/text/template/exec.go