edit/reader.go: Make race detector happy.

This commit is contained in:
Qi Xiao 2016-02-23 14:55:56 +01:00
parent a424136b1d
commit 0fc6c01077

View File

@ -79,14 +79,15 @@ func (rd *Reader) ErrorChan() <-chan error {
// a separate goroutine.
func (rd *Reader) Run() {
runes := rd.ar.Chan()
rd.quit = make(chan struct{})
quit := make(chan struct{})
rd.quit = quit
go rd.ar.Run()
for {
select {
case r := <-runes:
rd.readOne(r)
case <-rd.quit:
case <-quit:
return
}
}