Fix query with uninitialized map
This commit is contained in:
		
							parent
							
								
									9f533950a2
								
							
						
					
					
						commit
						9635d25150
					
				
							
								
								
									
										3
									
								
								scan.go
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								scan.go
									
									
									
									
									
								
							| @ -130,6 +130,9 @@ func Scan(rows *sql.Rows, db *DB, mode ScanMode) { | ||||
| 			mapValue, ok := dest.(map[string]interface{}) | ||||
| 			if !ok { | ||||
| 				if v, ok := dest.(*map[string]interface{}); ok { | ||||
| 					if *v == nil { | ||||
| 						*v = map[string]interface{}{} | ||||
| 					} | ||||
| 					mapValue = *v | ||||
| 				} | ||||
| 			} | ||||
|  | ||||
| @ -8,7 +8,7 @@ require ( | ||||
| 	github.com/lib/pq v1.10.3 | ||||
| 	gorm.io/driver/mysql v1.1.3 | ||||
| 	gorm.io/driver/postgres v1.2.1 | ||||
| 	gorm.io/driver/sqlite v1.2.2 | ||||
| 	gorm.io/driver/sqlite v1.2.3 | ||||
| 	gorm.io/driver/sqlserver v1.1.2 | ||||
| 	gorm.io/gorm v1.22.0 | ||||
| ) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jinzhu
						Jinzhu