Skip to content

Commit

Permalink
cmd/ursrv: Replace "2006-01-02" with time.DateOnly (syncthing#9157)
Browse files Browse the repository at this point in the history
This commit replaces "2006-01-02" to time.DateOnly. time.DateOnly is
introduced since Go1.20
  • Loading branch information
orangekame3 authored Oct 11, 2023
1 parent ea1ea36 commit 5eb2058
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/ursrv/serve/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ func getSummary(db *sql.DB, min int) (summary, error) {
ver = ver[:3] + "0" + ver[3:] // now v0.0x
}

s.setCount(day.Format("2006-01-02"), ver, num)
s.setCount(day.Format(time.DateOnly), ver, num)
}

s.filter(min)
Expand All @@ -1041,7 +1041,7 @@ func getPerformance(db *sql.DB) ([][]interface{}, error) {
return nil, err
}

row := []interface{}{day.Format("2006-01-02"), totFiles, totMiB, float64(int(sha256Perf*10)) / 10, memorySize, memoryUsage}
row := []interface{}{day.Format(time.DateOnly), totFiles, totMiB, float64(int(sha256Perf*10)) / 10, memorySize, memoryUsage}
res = append(res, row)
}

Expand Down Expand Up @@ -1071,7 +1071,7 @@ func getBlockStats(db *sql.DB) ([][]interface{}, error) {
continue
}
row := []interface{}{
day.Format("2006-01-02"),
day.Format(time.DateOnly),
reports,
pulled / blocksToGb,
renamed / blocksToGb,
Expand Down

0 comments on commit 5eb2058

Please sign in to comment.