]> Cypherpunks repositories - gostls13.git/commit
time: fix Parse to ignore extra sub-nanosecond digits
authorJoe Tsai <joetsai@digital-static.net>
Sun, 21 Aug 2022 09:36:24 +0000 (02:36 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 23 Aug 2022 17:19:32 +0000 (17:19 +0000)
commit4e9183cb14bf58011389c8a8c8ccaecd3ef50451
tree6336416880882794498ca0d0a4812b1142913d4f
parent42794f3871c35d1b3837f78f29d781b6ab1c1a64
time: fix Parse to ignore extra sub-nanosecond digits

This modifies the code to match the comment such that
the behavior truly is identical to stdSecond case.
Also, it modifies the behavior to match the documented
behavior where:

    Fractional seconds are truncated to nanosecond precision.

Fixes #54567
Updates #48685

Change-Id: Ie64549e4372ab51624c105ad8ab4cc99b9b5a0b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/425037
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Joseph Tsai <joetsai@digital-static.net>
src/time/format.go
src/time/format_test.go