1
0
mirror of https://github.com/golang/go synced 2024-11-18 15:04:44 -07:00
go/src
Rob Pike 64c39a3093 text/template: shut down lexing goroutine on error
When a parse error occurred, the lexing goroutine would lay idle.
It's not likely a problem but if the program is for some reason
accepting badly formed data repeatedly, it's wasteful.

The solution is easy: Just drain the input on error. We know this
will succeed because the input is always a string and is therefore
guaranteed finite.

With debugging prints in the package tests I've shown this is effective,
shutting down 79 goroutines that would otherwise linger, out of 123 total.

Fixes #10574.

Change-Id: I8aa536e327b219189a7e7f604a116fa562ae1c39
Reviewed-on: https://go-review.googlesource.com/9658
Reviewed-by: Russ Cox <rsc@golang.org>
2015-05-05 16:02:19 +00:00
..
archive archive/tar: fix error message 2015-05-04 21:27:45 +00:00
bufio
builtin
bytes bytes, strings: add LastIndexByte 2015-04-30 07:13:18 +00:00
cmd cmd/internal: disable OSQRT on GOARM=5 2015-05-05 05:57:09 +00:00
compress
container
crypto crypto/x509: be strict about trailing data. 2015-04-30 03:49:36 +00:00
database/sql
debug debug/dwarf: update class_string.go to add ClassReferenceSig using stringer. 2015-04-27 02:05:20 +00:00
encoding encoding/asn1: Improved control of flags and times 2015-04-28 16:35:13 +00:00
errors
expvar
flag
fmt fmt: catch overflow in width and prec calculations 2015-05-04 19:17:05 +00:00
go go/build: reserve GOARCH values for all common architectures 2015-05-05 04:19:28 +00:00
hash hash/crc32: move reverse representation docs to an example 2015-05-04 00:19:22 +00:00
html html/template: fix quadratic performance with special tags 2015-04-30 16:22:29 +00:00
image image/gif: be consistent wrt "color map" or "color table" names. 2015-05-05 06:14:41 +00:00
index/suffixarray
internal mime, time, internal/syscall/windows/registry: use new registry package to simplify code 2015-04-30 04:33:42 +00:00
io
log
math math/big: add modular square-root and Jacobi functions 2015-04-30 04:02:58 +00:00
mime mime, time, internal/syscall/windows/registry: use new registry package to simplify code 2015-04-30 04:33:42 +00:00
net net: fix inconsistent errors 2015-05-05 09:40:07 +00:00
os strings: use LastIndexByte in LastIndex 2015-04-30 08:33:29 +00:00
path
reflect runtime: add pointer size to type structure 2015-05-04 20:17:48 +00:00
regexp regexp: trivial change in comments to update code.google.com link 2015-04-27 20:18:25 +00:00
runtime runtime: let freezetheworld work even when gomaxprocs=1 2015-05-05 15:11:10 +00:00
sort
strconv
strings strings: use LastIndexByte in LastIndex 2015-04-30 08:33:29 +00:00
sync
syscall syscall: fix little-endian assumptions 2015-05-03 04:11:28 +00:00
testing testing/quick: align tests with reflect.Kind. 2015-04-26 02:40:40 +00:00
text text/template: shut down lexing goroutine on error 2015-05-05 16:02:19 +00:00
time time: Fix ordering of slots in AfterQueueing test 2015-05-04 16:49:37 +00:00
unicode
unsafe
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash src: build cmd in buildall.bash 2015-04-30 00:02:59 +00:00
clean.bash
clean.bat
clean.rc
iostest.bash
make.bash
make.bat
Make.dist
make.rc
nacltest.bash nacltest.bash: remove syscall/fstest_nacl.go after test 2015-05-02 02:48:32 +00:00
race.bash
race.bat
run.bash
run.bat
run.rc