v0.0.102
This commit is contained in:
parent
c5e23ab451
commit
c13db6802e
@ -66,6 +66,10 @@ func (t *RFC3339Time) UnmarshalText(data []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *RFC3339Time) UnmarshalBSONValue(bt bsontype.Type, data []byte) error {
|
func (t *RFC3339Time) UnmarshalBSONValue(bt bsontype.Type, data []byte) error {
|
||||||
|
if bt == bsontype.Null {
|
||||||
|
*t = RFC3339Time{}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if bt != bsontype.DateTime {
|
if bt != bsontype.DateTime {
|
||||||
return errors.New(fmt.Sprintf("cannot unmarshal %v into RFC3339Time", bt))
|
return errors.New(fmt.Sprintf("cannot unmarshal %v into RFC3339Time", bt))
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,10 @@ func (t *RFC3339NanoTime) UnmarshalText(data []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *RFC3339NanoTime) UnmarshalBSONValue(bt bsontype.Type, data []byte) error {
|
func (t *RFC3339NanoTime) UnmarshalBSONValue(bt bsontype.Type, data []byte) error {
|
||||||
|
if bt == bsontype.Null {
|
||||||
|
*t = RFC3339NanoTime{}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if bt != bsontype.DateTime {
|
if bt != bsontype.DateTime {
|
||||||
return errors.New(fmt.Sprintf("cannot unmarshal %v into RFC3339NanoTime", bt))
|
return errors.New(fmt.Sprintf("cannot unmarshal %v into RFC3339NanoTime", bt))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user