From be0f294ec314bfe0148f1191a6b2c1c88cea7234 Mon Sep 17 00:00:00 2001 From: cncsmonster Date: Mon, 23 Oct 2023 00:07:23 +0800 Subject: [PATCH] fix: fix lint errros in pkg/statics --- pkg/statistics/statistics.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/statistics/statistics.go b/pkg/statistics/statistics.go index de6d04fec..080933c73 100644 --- a/pkg/statistics/statistics.go +++ b/pkg/statistics/statistics.go @@ -36,9 +36,8 @@ func (s *Statistics) output() { var timeIntervalNum uint64 for { sum = *s.AllCount - select { - case <-t.C: - } + <-t.C + if *s.AllCount-sum <= 0 { intervalCount = 0 } else { @@ -66,5 +65,6 @@ func (s *Statistics) output() { func NewStatistics(allCount *uint64, moduleName, printArgs string, sleepTime int) *Statistics { p := &Statistics{AllCount: allCount, ModuleName: moduleName, SleepTime: uint64(sleepTime), PrintArgs: printArgs} go p.output() + return p }