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 } }