]> Cypherpunks repositories - gostls13.git/commit
time: fix Parse for empty seconds
authorJoe Tsai <joetsai@digital-static.net>
Sun, 21 Aug 2022 09:21:49 +0000 (02:21 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 23 Aug 2022 17:35:01 +0000 (17:35 +0000)
commitf9cdc09497af299ef6a4d4d745aa0df4ebfdce52
tree8ed63d9e11b49de8427396a28d0a48c506b13694
parent4e9183cb14bf58011389c8a8c8ccaecd3ef50451
time: fix Parse for empty seconds

The error return value of the seconds field is overwritten
and not checked in the presence of a fractional second.
Perform an explicit check for errors.

Fixes #54569

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