1
0
mirror of https://github.com/nxshock/gwp.git synced 2024-11-27 03:31:02 +05:00

Do not show zero estimate count

This commit is contained in:
nxshock 2021-11-04 19:01:40 +05:00
parent c25093e8e2
commit 2a342398b9

9
gwp.go
View File

@ -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%%)",