mirror of
https://github.com/moby/moby.git
synced 2026-07-09 08:07:56 +00:00
pkg/jsonmessage/jsonmessage.go:111:10: Multiplication of durations: `(left / time.Second) * time.Second` (durationcheck)
left = (left / time.Second) * time.Second
^
This code was rounding down time remaining to the nearest second;
- Use go's time.Duration.Round() instead
- Make the calculation conditional, as it was only used if there's enough
space available to print
- Move the declaration of the timeLeftBox var closer to where used.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>