mirror of
https://github.com/golang/go
synced 2024-11-18 15:04:44 -07:00
64c39a3093
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> |
||
---|---|---|
.. | ||
archive | ||
bufio | ||
builtin | ||
bytes | ||
cmd | ||
compress | ||
container | ||
crypto | ||
database/sql | ||
debug | ||
encoding | ||
errors | ||
expvar | ||
flag | ||
fmt | ||
go | ||
hash | ||
html | ||
image | ||
index/suffixarray | ||
internal | ||
io | ||
log | ||
math | ||
mime | ||
net | ||
os | ||
path | ||
reflect | ||
regexp | ||
runtime | ||
sort | ||
strconv | ||
strings | ||
sync | ||
syscall | ||
testing | ||
text | ||
time | ||
unicode | ||
unsafe | ||
all.bash | ||
all.bat | ||
all.rc | ||
androidtest.bash | ||
bootstrap.bash | ||
buildall.bash | ||
clean.bash | ||
clean.bat | ||
clean.rc | ||
iostest.bash | ||
make.bash | ||
make.bat | ||
Make.dist | ||
make.rc | ||
nacltest.bash | ||
race.bash | ||
race.bat | ||
run.bash | ||
run.bat | ||
run.rc |