mirror of
https://github.com/araddon/dateparse.git
synced 2025-08-20 20:28:40 +08:00
Improve golint happiness
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user