From 0d88e220f96005e83240c5ea9b60536fc5185ff8 Mon Sep 17 00:00:00 2001 From: Aaron Raddon Date: Sat, 12 Aug 2017 09:50:14 -0700 Subject: [PATCH] Improve golint happiness --- bench_test.go | 4 ++-- parseany.go | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/bench_test.go b/bench_test.go index 0813f68..5b8e1b8 100644 --- a/bench_test.go +++ b/bench_test.go @@ -50,7 +50,7 @@ var ( "2014-04-26", } - DateFormatError = fmt.Errorf("Invalid Date Format") + ErrDateFormat = fmt.Errorf("Invalid Date Format") timeFormats = []string{ // ISO 8601ish formats @@ -87,5 +87,5 @@ func parseShotgunStyle(raw string) (time.Time, error) { return t, nil } } - return time.Time{}, DateFormatError + return time.Time{}, ErrDateFormat } diff --git a/parseany.go b/parseany.go index 3c2efd1..b9b8ac5 100644 --- a/parseany.go +++ b/parseany.go @@ -735,11 +735,10 @@ iterRunes: return parse("2006/01/02", datestr, loc) } return parse("2006/1/2", datestr, loc) - } else { - for _, parseFormat := range shortDates { - if t, err := parse(parseFormat, datestr, loc); err == nil { - return t, nil - } + } + for _, parseFormat := range shortDates { + if t, err := parse(parseFormat, datestr, loc); err == nil { + return t, nil } }