From: Keith Rarick Date: Thu, 12 Jul 2018 06:08:21 +0000 (-0700) Subject: time: fix typo in Truncate example X-Git-Tag: go1.11beta2~131 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=33c7f88eafde1a15b8c60e208d526b436cc6d02e;p=gostls13.git 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/123516 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/time/example_test.go b/src/time/example_test.go index e64b0eced1..494a416802 100644 --- a/src/time/example_test.go +++ b/src/time/example_test.go @@ -74,17 +74,17 @@ func ExampleDuration_Truncate() { } 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: - // t.Truncate( 1ns) = 1h15m30.918273645s - // t.Truncate( 1µs) = 1h15m30.918273s - // t.Truncate( 1ms) = 1h15m30.918s - // t.Truncate( 1s) = 1h15m30s - // t.Truncate( 2s) = 1h15m30s - // t.Truncate( 1m0s) = 1h15m0s - // t.Truncate( 10m0s) = 1h10m0s - // t.Truncate(1h0m0s) = 1h0m0s + // d.Truncate( 1ns) = 1h15m30.918273645s + // d.Truncate( 1µs) = 1h15m30.918273s + // d.Truncate( 1ms) = 1h15m30.918s + // d.Truncate( 1s) = 1h15m30s + // d.Truncate( 2s) = 1h15m30s + // d.Truncate( 1m0s) = 1h15m0s + // d.Truncate( 10m0s) = 1h10m0s + // d.Truncate(1h0m0s) = 1h0m0s } func ExampleParseDuration() {