Skip to content

Commit 568bdb2

Browse files
armswordfiorix
authored andcommitted
fix the Indent Error Flow
1 parent 3f29745 commit 568bdb2

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

presto/presto.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,19 +1051,17 @@ func scanNullFloat64(v interface{}) (sql.NullFloat64, error) {
10511051
vv, ok := v.(float64)
10521052
if ok {
10531053
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-
}
10651054
}
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+
}
10671065
}
10681066

10691067
// NullSliceFloat64 represents a slice of float64 that may be null.

0 commit comments

Comments
 (0)