Simplify time calculation in listRun test
Replaces explicit duration parsing with direct multiplication for calculating a timestamp 6 hours ago in Test_listRun, improving code clarity.
This commit is contained in:
parent
97da7fc1d2
commit
4a07cdf940
1 changed files with 1 additions and 3 deletions
|
|
@ -77,9 +77,7 @@ func TestNewCmdList(t *testing.T) {
|
|||
}
|
||||
|
||||
func Test_listRun(t *testing.T) {
|
||||
sixHours, _ := time.ParseDuration("6h")
|
||||
sixHoursAgo := time.Now().Add(-sixHours)
|
||||
createdAt := sixHoursAgo.Format(time.RFC3339)
|
||||
createdAt := time.Now().Add(-6 * time.Hour).Format(time.RFC3339) // 6h ago
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue