Skip to content

Commit

Permalink
Avoid time.Compare
Browse files Browse the repository at this point in the history
It looks like the github action build environment for this repo uses
a go 1.19.x environment which does not have time.Compare(). Replace
with time.Before() and time.After() instead.

(cherry picked from commit a579ea8)
(cherry picked from commit ffd8a2d)
(cherry picked from commit 24eaaf5)
(cherry picked from commit 6020e24)
(cherry picked from commit 3abc47f)
(cherry picked from commit a1f95a8)
  • Loading branch information
mikeb26 committed Aug 22, 2024
1 parent 5e3e84e commit 121bab2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions billing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ func TestBillingUsageSessKey(t *testing.T) {
resp.TotalUsage)
}
for idx, dc := range resp.DailyCosts {
if dc.Time.Compare(startDate) < 0 {
if dc.Time.Before(startDate) {
t.Errorf("expected daily cost%v date(%v) before start date %v", idx,
dc.Time, TestStartDate)
}
if dc.Time.Compare(endDate) > 0 {
if dc.Time.After(endDate) {
t.Errorf("expected daily cost%v date(%v) after end date %v", idx,
dc.Time, TestEndDate)
}
Expand Down

0 comments on commit 121bab2

Please sign in to comment.