Skip to content

Commit 979dd99

Browse files
committed
Avoid unnecessary conversions
1 parent 3c5ed6f commit 979dd99

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func ConfigValue(v interface{}, dst interface{}) error {
107107
*d = int64(vt)
108108
case string:
109109
x, _ := strconv.ParseInt(vt, 0, 64)
110-
*d = int64(x)
110+
*d = x
111111
default:
112112
return fmt.Errorf("unhandled type %+v for uint8 conversion", reflect.TypeOf(vt))
113113
}
@@ -120,7 +120,7 @@ func ConfigValue(v interface{}, dst interface{}) error {
120120
*d = vt
121121
case string:
122122
x, _ := strconv.ParseFloat(vt, 64)
123-
*d = float64(x)
123+
*d = x
124124
default:
125125
return fmt.Errorf("unhandled type %+v for float64 conversion", reflect.TypeOf(vt))
126126
}

0 commit comments

Comments
 (0)