]> Cypherpunks repositories - gostls13.git/commitdiff
time: fix incorrect "zero pad" comment in example
authorBlixt <me@blixt.nyc>
Wed, 1 Nov 2017 20:25:24 +0000 (16:25 -0400)
committerTobias Klauser <tobias.klauser@gmail.com>
Thu, 2 Nov 2017 09:01:40 +0000 (09:01 +0000)
The comment currently implies that a zero will be added, but the
underscore is used to add a space for single-digit dates.

Change-Id: Ib3bac8a16bc2d1fcb26ab3bb7ad172b89e1a4a24
Reviewed-on: https://go-review.googlesource.com/75230
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/time/example_test.go

index 98a2d532a37731f4eb2f175be6dcc50eae49f4d7..34df8daef2ca9d7bcba18987c91201a7abe8c33a 100644 (file)
@@ -238,10 +238,10 @@ func ExampleTime_Format() {
        // value.
        do("No pad", "<2>", "<7>")
 
-       // An underscore represents a zero pad, if required.
+       // An underscore represents a space pad, if the date only has one digit.
        do("Spaces", "<_2>", "< 7>")
 
-       // Similarly, a 0 indicates zero padding.
+       // A "0" indicates zero padding for single-digit values.
        do("Zeros", "<02>", "<07>")
 
        // If the value is already the right width, padding is not used.