v0.0.589 improve Equal method of rfctime structs - prevents panic in cmp library
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m48s

This commit is contained in:
2025-07-15 13:46:36 +02:00
parent a4b2a0589f
commit 8ea9b3f79f
8 changed files with 45 additions and 13 deletions

View File

@@ -4,11 +4,11 @@ import (
"encoding/json"
"errors"
"fmt"
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/bsoncodec"
"go.mongodb.org/mongo-driver/bson/bsonrw"
"go.mongodb.org/mongo-driver/bson/bsontype"
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
"reflect"
"strconv"
"time"
@@ -136,7 +136,13 @@ func (t UnixTime) Before(u AnyTime) bool {
return t.Time().Before(tt(u))
}
func (t UnixTime) Equal(u AnyTime) bool {
func (t *UnixTime) Equal(u AnyTime) bool {
if t == nil && u == nil {
return true
}
if t == nil || u == nil {
return false
}
return t.Time().Equal(tt(u))
}