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.
  • Loading branch information
mikeb26 committed Nov 17, 2023
1 parent 3f01fbd commit 8f923f5
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 8f923f5

Please sign in to comment.