diff options
author | Gabriel Russell <gabriel.russell@gmail.com> | 2016-08-23 08:31:26 -0400 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2016-08-23 15:58:08 +0000 |
commit | eb29ac7a7cf97cd364c9d343377b104bc3e90927 (patch) | |
tree | 5d27fa2e3d499fa9c9d9ce0333134b40c9245438 /src/time/format.go | |
parent | 03723c909ee7b75c0c88ddb3f547642b9f48b009 (diff) | |
download | go-eb29ac7a7cf97cd364c9d343377b104bc3e90927.tar.gz go-eb29ac7a7cf97cd364c9d343377b104bc3e90927.zip |
time: fix optional fractional seconds range err
The optional fractional seconds overrides any range error
from the second parsing. Instead don't look for optional fractional
seconds if a range error has occured.
Change-Id: I27e0a2432740f6753668bd8833e48b9495bc4036
Reviewed-on: https://go-review.googlesource.com/27590
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/time/format.go')
-rw-r--r-- | src/time/format.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/time/format.go b/src/time/format.go index c2ae793020..18a73c45ba 100644 --- a/src/time/format.go +++ b/src/time/format.go @@ -844,6 +844,7 @@ func parse(layout, value string, defaultLocation, local *Location) (Time, error) sec, value, err = getnum(value, std == stdZeroSecond) if sec < 0 || 60 <= sec { rangeErrString = "second" + break } // Special case: do we have a fractional second but no // fractional second in the format? |