This commit is contained in:
2023-04-13 14:40:07 +02:00
parent c5e23ab451
commit c13db6802e
2 changed files with 8 additions and 0 deletions

View File

@@ -66,6 +66,10 @@ func (t *RFC3339NanoTime) UnmarshalText(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 {
return errors.New(fmt.Sprintf("cannot unmarshal %v into RFC3339NanoTime", bt))
}