audit empty compare date strings

This commit is contained in:
Arnas Udovic 2025-07-01 21:31:48 +03:00
parent acd69803d6
commit 3a38cd0f19

View file

@ -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
}
}