Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Optimize code by using built-in constants in the standard lib #844

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func parseStatus(data sql.RawBytes) (float64, bool) {
if ts, err := time.Parse("Jan 02 15:04:05 2006 MST", string(data)); err == nil {
return float64(ts.Unix()), true
}
if ts, err := time.Parse("2006-01-02 15:04:05", string(data)); err == nil {
if ts, err := time.Parse(time.DateTime, string(data)); err == nil {
return float64(ts.Unix()), true
}
if logNum := logRE.Find(data); logNum != nil {
Expand Down