From 42954e85025d2c97a3f040f17f3b5ec9967db61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Thu, 27 Mar 2025 16:04:26 -0400 Subject: [PATCH] simplify conversion of `bson.DateTime`s to `time.Time`s in `handleAnon` --- query.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/query.go b/query.go index 3f1afe1..e9e0e76 100644 --- a/query.go +++ b/query.go @@ -10,7 +10,6 @@ import ( "log" "reflect" "strings" - "time" ) type Query struct { @@ -472,7 +471,7 @@ func handleAnon(raw interface{}, rtype reflect.Type, rval reflect.Value) reflect if ok { fval := amap[btag.Name] if reflect.TypeOf(fval) == reflect.TypeFor[bson.DateTime]() { - fval = time.UnixMilli(int64(fval.(bson.DateTime))) + fval = fval.(bson.DateTime).Time() } if valueField.Kind() == reflect.Pointer { valueField.Elem().Set(reflect.ValueOf(fval))