From 3a38cd0f19275edc0dae55296de1bbbdb3b07804 Mon Sep 17 00:00:00 2001 From: Arnas Udovic Date: Tue, 1 Jul 2025 21:31:48 +0300 Subject: [PATCH] audit empty compare date strings --- audit.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/audit.go b/audit.go index a003b0a..b688a80 100644 --- a/audit.go +++ b/audit.go @@ -20,6 +20,7 @@ import ( "encoding/json" "fmt" "net/http" + "strings" "time" ) @@ -63,7 +64,7 @@ func doAudit(host string, filter string) bool { currentTime := time.Now() last3Month := currentTime.AddDate(0,-3,0) - if instance.CreatedAt < last3Month.Format("2006-01-02T15:04:05Z") { + if strings.Compare(instance.CreatedAt, last3Month.Format("2006-01-02T15:04:05Z")) < 1 { return true } }