diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2024-09-10 12:47:22 +0200 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-09-10 21:43:25 +0000 |
| commit | aef61555dae947826e8ee69ff0e31efc4a1d4179 (patch) | |
| tree | 54eda2dd0b1e633fdf0233ebe5e2736209c2ff1a /src | |
| parent | d288776d9143370567fa56b44fa875d0e8fb02b6 (diff) | |
| download | go-aef61555dae947826e8ee69ff0e31efc4a1d4179.tar.xz | |
time: don't check non-nil err twice in parse
Change-Id: I40a1b49035321b05032eacf4525a62b8c562e0d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/612195
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Tim King <taking@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/time/format.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/time/format.go b/src/time/format.go index cab78f73a0..b9cd702c0d 100644 --- a/src/time/format.go +++ b/src/time/format.go @@ -1259,9 +1259,9 @@ func parse(layout, value string, defaultLocation, local *Location) (Time, error) hr, _, err = getnum(hour, true) if err == nil { mm, _, err = getnum(min, true) - } - if err == nil { - ss, _, err = getnum(seconds, true) + if err == nil { + ss, _, err = getnum(seconds, true) + } } // The range test use > rather than >=, |
