mirror of
https://github.com/araddon/dateparse.git
synced 2024-11-10 11:51:54 +08:00
Improve golint happiness
This commit is contained in:
parent
febb340f9d
commit
0d88e220f9
@ -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,13 +735,12 @@ 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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case stateDigitSlashWSColon: // starts digit then slash 02/ more digits/slashes then whitespace
|
||||
// 4/8/2014 22:05
|
||||
|
Loading…
Reference in New Issue
Block a user