Commit 33c7f88e authored by Keith Rarick's avatar Keith Rarick Committed by Brad Fitzpatrick

time: fix typo in Truncate example

The existing example code uses variable name d, but
prints t in its output. It's needlessly confusing.

Change-Id: I67bef3c732e84d2d89819f96b4b62663630fd69e
Reviewed-on: https://go-review.googlesource.com/123516Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent a7bcb539
...@@ -74,17 +74,17 @@ func ExampleDuration_Truncate() { ...@@ -74,17 +74,17 @@ func ExampleDuration_Truncate() {
} }
for _, t := range trunc { for _, t := range trunc {
fmt.Printf("t.Truncate(%6s) = %s\n", t, d.Truncate(t).String()) fmt.Printf("d.Truncate(%6s) = %s\n", t, d.Truncate(t).String())
} }
// Output: // Output:
// t.Truncate( 1ns) = 1h15m30.918273645s // d.Truncate( 1ns) = 1h15m30.918273645s
// t.Truncate( 1µs) = 1h15m30.918273s // d.Truncate( 1µs) = 1h15m30.918273s
// t.Truncate( 1ms) = 1h15m30.918s // d.Truncate( 1ms) = 1h15m30.918s
// t.Truncate( 1s) = 1h15m30s // d.Truncate( 1s) = 1h15m30s
// t.Truncate( 2s) = 1h15m30s // d.Truncate( 2s) = 1h15m30s
// t.Truncate( 1m0s) = 1h15m0s // d.Truncate( 1m0s) = 1h15m0s
// t.Truncate( 10m0s) = 1h10m0s // d.Truncate( 10m0s) = 1h10m0s
// t.Truncate(1h0m0s) = 1h0m0s // d.Truncate(1h0m0s) = 1h0m0s
} }
func ExampleParseDuration() { func ExampleParseDuration() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment