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
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m48s
This commit is contained in:
@@ -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"
|
||||
"time"
|
||||
)
|
||||
@@ -142,7 +142,13 @@ func (t RFC3339NanoTime) Before(u AnyTime) bool {
|
||||
return t.Time().Before(tt(u))
|
||||
}
|
||||
|
||||
func (t RFC3339NanoTime) Equal(u AnyTime) bool {
|
||||
func (t *RFC3339NanoTime) Equal(u AnyTime) bool {
|
||||
if t == nil && u == nil {
|
||||
return true
|
||||
}
|
||||
if t == nil || u == nil {
|
||||
return false
|
||||
}
|
||||
return t.Time().Equal(tt(u))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user