Skip to content

Commit

Permalink
cluster: reverse the order of audit log list (#1538)
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroProfundis committed Sep 1, 2021
1 parent 66741de commit 9176d5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/cluster/audit/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func GetAuditList(dir string) ([]Item, error) {
}

sort.Slice(auditList, func(i, j int) bool {
return auditList[i].Time > auditList[j].Time
return auditList[i].Time < auditList[j].Time
})

return auditList, nil
Expand Down
6 changes: 3 additions & 3 deletions pkg/cluster/audit/audit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ func (s *testAuditSuite) TestShowAuditLog(c *C) {
// tabby table size is based on column width, while time.RFC3339 maybe print out timezone like +08:00 or Z(UTC)
// skip the first two lines
list := strings.Join(strings.Split(readFakeStdout(f), "\n")[2:], "\n")
c.Assert(list, Equals, fmt.Sprintf(`ftmpqzww84Q %s test with nanosecond
4F7ZTL %s test with second
c.Assert(list, Equals, fmt.Sprintf(`4F7ZTL %s test with second
ftmpqzww84Q %s test with nanosecond
`,
time.Unix(nanoSecond/1e9, 0).Format(time.RFC3339),
time.Unix(second, 0).Format(time.RFC3339),
time.Unix(nanoSecond/1e9, 0).Format(time.RFC3339),
))
f.Close()

Expand Down

0 comments on commit 9176d5e

Please sign in to comment.