diff --git a/decor/speed.go b/decor/speed.go index 69d0802..dc3ab9c 100644 --- a/decor/speed.go +++ b/decor/speed.go @@ -227,8 +227,11 @@ } wc.BuildFormat() startTime := time.Now() + var str string return DecoratorFunc(func(st *Statistics, widthAccumulator chan<- int, widthDistributor <-chan int) string { - var str string + if st.Completed { + return wc.FormatMsg(str, widthAccumulator, widthDistributor) + } timeElapsed := time.Since(startTime) speed := float64(st.Current) / timeElapsed.Seconds()