aboutsummaryrefslogtreecommitdiff
path: root/src/time/time_test.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2016-04-21 14:53:19 -0700
committerRob Pike <r@golang.org>2016-04-21 22:07:59 +0000
commit9c4295b574a89bf02294111f811f90ab06b9951b (patch)
tree03ac053a086b34c29d3d6fa61864fbe7cf32fd4c /src/time/time_test.go
parenta33e9cf7ead3d7853546a71796a6c404d02cb474 (diff)
downloadgo-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.go2
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},