Skip to content

Commit 33c7f88

Browse files
krbradfitz
authored andcommitted
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 <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent a7bcb53 commit 33c7f88

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/time/example_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,17 @@ func ExampleDuration_Truncate() {
7474
}
7575

7676
for _, t := range trunc {
77-
fmt.Printf("t.Truncate(%6s) = %s\n", t, d.Truncate(t).String())
77+
fmt.Printf("d.Truncate(%6s) = %s\n", t, d.Truncate(t).String())
7878
}
7979
// Output:
80-
// t.Truncate( 1ns) = 1h15m30.918273645s
81-
// t.Truncate( 1µs) = 1h15m30.918273s
82-
// t.Truncate( 1ms) = 1h15m30.918s
83-
// t.Truncate( 1s) = 1h15m30s
84-
// t.Truncate( 2s) = 1h15m30s
85-
// t.Truncate( 1m0s) = 1h15m0s
86-
// t.Truncate( 10m0s) = 1h10m0s
87-
// t.Truncate(1h0m0s) = 1h0m0s
80+
// d.Truncate( 1ns) = 1h15m30.918273645s
81+
// d.Truncate( 1µs) = 1h15m30.918273s
82+
// d.Truncate( 1ms) = 1h15m30.918s
83+
// d.Truncate( 1s) = 1h15m30s
84+
// d.Truncate( 2s) = 1h15m30s
85+
// d.Truncate( 1m0s) = 1h15m0s
86+
// d.Truncate( 10m0s) = 1h10m0s
87+
// d.Truncate(1h0m0s) = 1h0m0s
8888
}
8989

9090
func ExampleParseDuration() {

0 commit comments

Comments
 (0)