diff options
author | Rob Pike <r@golang.org> | 2016-04-21 14:53:19 -0700 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2016-04-21 22:07:59 +0000 |
commit | 9c4295b574a89bf02294111f811f90ab06b9951b (patch) | |
tree | 03ac053a086b34c29d3d6fa61864fbe7cf32fd4c /src/time/time_test.go | |
parent | a33e9cf7ead3d7853546a71796a6c404d02cb474 (diff) | |
download | go-9c4295b574a89bf02294111f811f90ab06b9951b.tar.gz go-9c4295b574a89bf02294111f811f90ab06b9951b.zip |
time: print zero duration as 0s, not 0
There should be a unit, and s is the SI unit name, so use that.
The other obvious possibility is ns (nanosecond), but the fact
that durations are measured in nanoseconds is an internal detail.
Fixes #14058.
Change-Id: Id1f8f3c77088224d9f7cd643778713d5cc3be5d9
Reviewed-on: https://go-review.googlesource.com/22357
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/time/time_test.go')
-rw-r--r-- | src/time/time_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/time/time_test.go b/src/time/time_test.go index 5a5451b5b8..b7ebb37296 100644 --- a/src/time/time_test.go +++ b/src/time/time_test.go @@ -533,7 +533,7 @@ var durationTests = []struct { str string d Duration }{ - {"0", 0}, + {"0s", 0}, {"1ns", 1 * Nanosecond}, {"1.1µs", 1100 * Nanosecond}, {"2.2ms", 2200 * Microsecond}, |