File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -1051,19 +1051,17 @@ func scanNullFloat64(v interface{}) (sql.NullFloat64, error) {
1051
1051
vv , ok := v .(float64 )
1052
1052
if ok {
1053
1053
return sql.NullFloat64 {Valid : true , Float64 : vv }, nil
1054
- } else {
1055
- switch v {
1056
- case "NaN" :
1057
- return sql.NullFloat64 {Valid : true , Float64 : math .NaN ()}, nil
1058
- case "Infinity" :
1059
- return sql.NullFloat64 {Valid : true , Float64 : math .Inf (+ 1 )}, nil
1060
- case "-Infinity" :
1061
- return sql.NullFloat64 {Valid : true , Float64 : math .Inf (- 1 )}, nil
1062
- default :
1063
- return sql.NullFloat64 {}, fmt .Errorf ("cannot convert %v (%T) to float64" , v , v )
1064
- }
1065
1054
}
1066
-
1055
+ switch v {
1056
+ case "NaN" :
1057
+ return sql.NullFloat64 {Valid : true , Float64 : math .NaN ()}, nil
1058
+ case "Infinity" :
1059
+ return sql.NullFloat64 {Valid : true , Float64 : math .Inf (+ 1 )}, nil
1060
+ case "-Infinity" :
1061
+ return sql.NullFloat64 {Valid : true , Float64 : math .Inf (- 1 )}, nil
1062
+ default :
1063
+ return sql.NullFloat64 {}, fmt .Errorf ("cannot convert %v (%T) to float64" , v , v )
1064
+ }
1067
1065
}
1068
1066
1069
1067
// NullSliceFloat64 represents a slice of float64 that may be null.
You can’t perform that action at this time.
0 commit comments