From 33c7f88eafde1a15b8c60e208d526b436cc6d02e Mon Sep 17 00:00:00 2001 From: Keith Rarick Date: Wed, 11 Jul 2018 23:08:21 -0700 Subject: [PATCH] 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 --- src/time/example_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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() { -- 2.50.0