simplify conversion of bson.DateTimes to time.Times in handleAnon
				
					
				
			This commit is contained in:
		
							parent
							
								
									d328bc3fbd
								
							
						
					
					
						commit
						42954e8502
					
				
							
								
								
									
										3
									
								
								query.go
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								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)) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user