From 2d0aaf58a57a47faab755ffe532d715271fe6956 Mon Sep 17 00:00:00 2001 From: Sangbum Kim Date: Mon, 11 Sep 2017 00:49:41 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=A8=EB=8F=84=20=EB=9D=BD=EA=B1=B8?= =?UTF-8?q?=EB=A6=AC=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- processor/processor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/processor/processor.go b/processor/processor.go index 92c6a37..9aabbeb 100644 --- a/processor/processor.go +++ b/processor/processor.go @@ -177,8 +177,7 @@ func (p *processor) getMaxTempetureOnProcessor(tempeturePathGlob string) (maxTem } tempetureReadWaiter := &sync.WaitGroup{} - queue := make(chan float64, len(matches)) - defer close(queue) + queue := make(chan float64, len(matches)-1) // exclude package temp for _, tempetureFilePath := range matches[1:] { @@ -186,6 +185,7 @@ func (p *processor) getMaxTempetureOnProcessor(tempeturePathGlob string) (maxTem go p.readTempeture(tempetureFilePath, queue, tempetureReadWaiter) } tempetureReadWaiter.Wait() + close(queue) for sense := range queue { if maxTempeture < sense { maxTempeture = sense