1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-03-17 21:07:54 +02:00

Merge pull request #1179 from ymh199478/fixed/parse-float

fix(config): strconv.ParseFloat use correct bitSize
This commit is contained in:
喵喵大人 2021-07-13 12:23:01 +08:00 committed by GitHub
commit aaecd4a642
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,8 +68,7 @@ func (v *atomicValue) Float() (float64, error) {
case int64:
return float64(val), nil
case string:
//todo: SA1030: 'bitSize' argument is invalid, must be either 32 or 64
return strconv.ParseFloat(val, 10) //nolint: staticcheck
return strconv.ParseFloat(val, 64)
}
return 0.0, fmt.Errorf("type assert to %v failed", reflect.TypeOf(v.Load()))
}