]> Cypherpunks repositories - gostls13.git/commitdiff
time: fix typo in ExampleParseDuration
authorRob Pike <r@golang.org>
Mon, 12 Feb 2024 00:35:29 +0000 (11:35 +1100)
committerRob Pike <r@golang.org>
Tue, 13 Feb 2024 01:05:00 +0000 (01:05 +0000)
A typo without consequences, but confusing nonetheless. The last
line prints micro2 and then micro, instead of micro2 twice.
One-character fix.

Fixes #65666

Change-Id: I61d636382a2223d53eac58d6ddbcc7c15b4efc85
Reviewed-on: https://go-review.googlesource.com/c/go/+/563275
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/time/example_test.go

index cfdee8f4d7ce4e94ecbdbda4d16248a44bb4fda8..53c20a051672a84eab4818e801c499366e3ce695 100644 (file)
@@ -99,7 +99,7 @@ func ExampleParseDuration() {
        fmt.Println(complex)
        fmt.Printf("There are %.0f seconds in %v.\n", complex.Seconds(), complex)
        fmt.Printf("There are %d nanoseconds in %v.\n", micro.Nanoseconds(), micro)
-       fmt.Printf("There are %6.2e seconds in %v.\n", micro2.Seconds(), micro)
+       fmt.Printf("There are %6.2e seconds in %v.\n", micro2.Seconds(), micro2)
        // Output:
        // 10h0m0s
        // 1h10m10s