updated dependencies and go
This commit is contained in:
+4
-5
@@ -7,7 +7,6 @@ import (
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
"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"
|
||||
@@ -96,7 +95,7 @@ func (t RFC3339Time) MarshalBSONValue() (bsontype.Type, []byte, error) {
|
||||
}
|
||||
|
||||
func (t RFC3339Time) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
||||
if val.Kind() == reflect.Ptr && val.IsNil() {
|
||||
if val.Kind() == reflect.Pointer && val.IsNil() {
|
||||
if !val.CanSet() {
|
||||
return errors.New("ValueUnmarshalerDecodeValue")
|
||||
}
|
||||
@@ -108,7 +107,7 @@ func (t RFC3339Time) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueRead
|
||||
return err
|
||||
}
|
||||
|
||||
if val.Kind() == reflect.Ptr && len(src) == 0 {
|
||||
if val.Kind() == reflect.Pointer && len(src) == 0 {
|
||||
val.Set(reflect.Zero(val.Type()))
|
||||
return nil
|
||||
}
|
||||
@@ -118,7 +117,7 @@ func (t RFC3339Time) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueRead
|
||||
return err
|
||||
}
|
||||
|
||||
if val.Kind() == reflect.Ptr {
|
||||
if val.Kind() == reflect.Pointer {
|
||||
val.Set(reflect.ValueOf(&t))
|
||||
} else {
|
||||
val.Set(reflect.ValueOf(t))
|
||||
@@ -258,7 +257,7 @@ func NewRFC3339Ptr(t *time.Time) *RFC3339Time {
|
||||
if t == nil {
|
||||
return nil
|
||||
}
|
||||
return langext.Ptr(RFC3339Time(*t))
|
||||
return new(RFC3339Time(*t))
|
||||
}
|
||||
|
||||
func NowRFC3339() RFC3339Time {
|
||||
|
||||
Reference in New Issue
Block a user