Improve golint happiness

This commit is contained in:
Aaron Raddon 2017-08-12 09:50:14 -07:00
parent febb340f9d
commit 0d88e220f9
2 changed files with 6 additions and 7 deletions

View File

@ -50,7 +50,7 @@ var (
"2014-04-26", "2014-04-26",
} }
DateFormatError = fmt.Errorf("Invalid Date Format") ErrDateFormat = fmt.Errorf("Invalid Date Format")
timeFormats = []string{ timeFormats = []string{
// ISO 8601ish formats // ISO 8601ish formats
@ -87,5 +87,5 @@ func parseShotgunStyle(raw string) (time.Time, error) {
return t, nil return t, nil
} }
} }
return time.Time{}, DateFormatError return time.Time{}, ErrDateFormat
} }

View File

@ -735,13 +735,12 @@ iterRunes:
return parse("2006/01/02", datestr, loc) return parse("2006/01/02", datestr, loc)
} }
return parse("2006/1/2", datestr, loc) return parse("2006/1/2", datestr, loc)
} else { }
for _, parseFormat := range shortDates { for _, parseFormat := range shortDates {
if t, err := parse(parseFormat, datestr, loc); err == nil { if t, err := parse(parseFormat, datestr, loc); err == nil {
return t, nil return t, nil
} }
} }
}
case stateDigitSlashWSColon: // starts digit then slash 02/ more digits/slashes then whitespace case stateDigitSlashWSColon: // starts digit then slash 02/ more digits/slashes then whitespace
// 4/8/2014 22:05 // 4/8/2014 22:05