From 2a342398b933e97f10240307118b59bf28058974 Mon Sep 17 00:00:00 2001 From: nxshock Date: Thu, 4 Nov 2021 19:01:40 +0500 Subject: [PATCH] Do not show zero estimate count --- gwp.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gwp.go b/gwp.go index dea1a3d..617c98b 100644 --- a/gwp.go +++ b/gwp.go @@ -87,8 +87,13 @@ func (workerPool *WorkerPool) printProgress() { } fmt.Fprintf(os.Stderr, newLine) - fmt.Fprintf(os.Stderr, "Progress: %.1f%% (%d / %d)", - float64(workerPool.processedCount*100)/float64(workerPool.EstimateCount), workerPool.processedCount, workerPool.EstimateCount) + + if workerPool.EstimateCount == 0 { + fmt.Fprintf(os.Stderr, "Progress: %d", workerPool.processedCount) + } else { + fmt.Fprintf(os.Stderr, "Progress: %.1f%% (%d / %d)", + float64(workerPool.processedCount*100)/float64(workerPool.EstimateCount), workerPool.processedCount, workerPool.EstimateCount) + } if workerPool.errorCount > 0 { fmt.Fprintf(os.Stderr, " Errors: %d (%.1f%%)",