Fix strconv.ParseFloat usage (#1335)
The bitSize argument of ParseFloat should either be 32 or 64, not 10. Found by staticcheck linter. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
parent
3df9a3cd86
commit
81cb783759
@ -67,8 +67,7 @@ func (f *Float64Flag) IsVisible() bool {
|
||||
func (f *Float64Flag) Apply(set *flag.FlagSet) error {
|
||||
if val, ok := flagFromEnvOrFile(f.EnvVars, f.FilePath); ok {
|
||||
if val != "" {
|
||||
valFloat, err := strconv.ParseFloat(val, 10)
|
||||
|
||||
valFloat, err := strconv.ParseFloat(val, 64)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not parse %q as float64 value for flag %s: %s", val, f.Name, err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user