simplified loop over channel inputs

This commit is contained in:
Philipp Mieden 2019-05-21 09:19:25 +02:00
parent 8f7c23ff4a
commit 42adb6a25a

View File

@ -24,13 +24,10 @@ func newStats() *stats {
chanCount: make(chan int), chanCount: make(chan int),
} }
go func() { go func() {
for { for _ = range s.chanCount {
select {
case <-s.chanCount:
s.requests++ s.requests++
s.chanCount <- 1 s.chanCount <- 1
} }
}
}() }()
return s return s
} }