]> Cypherpunks repositories - gostls13.git/commitdiff
time: update documentation for Duration.String regarding the zero value
authorRob Pike <r@golang.org>
Thu, 23 Jun 2016 22:28:36 +0000 (15:28 -0700)
committerRob Pike <r@golang.org>
Fri, 24 Jun 2016 19:41:45 +0000 (19:41 +0000)
It was out of date; in 1.7 the format changes to 0s.

Change-Id: I2013a1b0951afc5607828f313641b51c74433257
Reviewed-on: https://go-review.googlesource.com/24421
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/time/time.go

index d9dbd3449a04de2566606ba5ddea7bb30995a074..c31de357d58e29ec2159fa27cf96ffa9ab6d3814 100644 (file)
@@ -454,8 +454,7 @@ const (
 // String returns a string representing the duration in the form "72h3m0.5s".
 // Leading zero units are omitted. As a special case, durations less than one
 // second format use a smaller unit (milli-, micro-, or nanoseconds) to ensure
-// that the leading digit is non-zero. The zero duration formats as 0,
-// with no unit.
+// that the leading digit is non-zero. The zero duration formats as 0s.
 func (d Duration) String() string {
        // Largest time is 2540400h10m10.000000000s
        var buf [32]byte