From 24eaaf5202f636f022d41cfb7bf5605fe78ba0b7 Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Fri, 17 Nov 2023 16:48:37 +0000 Subject: [PATCH] Avoid time.Compare 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 a579ea88f65cf2e5c62d759e21f38b6e17d88cf7) (cherry picked from commit ffd8a2d71b79408eb3ab124fe034db9196518a84) --- billing_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/billing_test.go b/billing_test.go index 339ee4d54..1ed7afba8 100644 --- a/billing_test.go +++ b/billing_test.go @@ -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) }