From b7fd330caf3ec340dae51eebb8cb68a983614011 Mon Sep 17 00:00:00 2001 From: Chetan Sarva Date: Thu, 4 Nov 2021 14:36:50 -0400 Subject: [PATCH] fix: properly exit loop when chan is closed --- vhost.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vhost.go b/vhost.go index 53c7589..a95b751 100644 --- a/vhost.go +++ b/vhost.go @@ -166,8 +166,7 @@ func (v *Vhost) Close() { } func (v *Vhost) populateLogBuffer() { - for { - line := <-v.logChan + for line := range v.logChan { if v.logRing.Len() < 10 { v.logRing.PushBack(line) } else {