-
Notifications
You must be signed in to change notification settings - Fork 0
Update to latest urfave/cli #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -87,7 +87,7 @@ | |||||||||||||||||||||||||||||||||||||||||||
| apply = func(cmd *cli.Command) { | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetString(cmd.String(flagName)) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32: | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Int: | ||||||||||||||||||||||||||||||||||||||||||||
| var value int64 | ||||||||||||||||||||||||||||||||||||||||||||
| var err error | ||||||||||||||||||||||||||||||||||||||||||||
| if tags.defaultValue != "" { | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -96,17 +96,76 @@ | |||||||||||||||||||||||||||||||||||||||||||
| return fmt.Errorf("failed to parse int value %s for field %s: %w", tags.defaultValue, field.Name, err) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| flag = &cli.IntFlag{ | ||||||||||||||||||||||||||||||||||||||||||||
| Name: flagName, | ||||||||||||||||||||||||||||||||||||||||||||
| Aliases: tags.aliases, | ||||||||||||||||||||||||||||||||||||||||||||
| Usage: tags.help, | ||||||||||||||||||||||||||||||||||||||||||||
| DefaultText: tags.defaultValue, | ||||||||||||||||||||||||||||||||||||||||||||
| Value: value, | ||||||||||||||||||||||||||||||||||||||||||||
| Value: int(value), | ||||||||||||||||||||||||||||||||||||||||||||
| Sources: sources, | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| apply = func(cmd *cli.Command) { | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetInt(int64(cmd.Int(flagName))) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Int8: | ||||||||||||||||||||||||||||||||||||||||||||
| var value int64 | ||||||||||||||||||||||||||||||||||||||||||||
| var err error | ||||||||||||||||||||||||||||||||||||||||||||
| if tags.defaultValue != "" { | ||||||||||||||||||||||||||||||||||||||||||||
| value, err = strconv.ParseInt(tags.defaultValue, 10, 64) | ||||||||||||||||||||||||||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||||||||||||||||||||||||||
| return fmt.Errorf("failed to parse int value %s for field %s: %w", tags.defaultValue, field.Name, err) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| flag = &cli.Int8Flag{ | ||||||||||||||||||||||||||||||||||||||||||||
| Name: flagName, | ||||||||||||||||||||||||||||||||||||||||||||
| Aliases: tags.aliases, | ||||||||||||||||||||||||||||||||||||||||||||
| Usage: tags.help, | ||||||||||||||||||||||||||||||||||||||||||||
| DefaultText: tags.defaultValue, | ||||||||||||||||||||||||||||||||||||||||||||
| Value: int8(value), //nolint: gosec | ||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incorrect conversion between integer types High
Incorrect conversion of a signed 64-bit integer from
strconv.ParseInt Error loading related location Loading
Copilot AutofixAI 12 months ago To fix the issue, we need to ensure that the value parsed by The fix involves:
The changes will be made in the
Suggested changeset
1
config.go
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||||||||||||||
| Sources: sources, | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| apply = func(cmd *cli.Command) { | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetInt(int64(cmd.Int8(flagName))) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Int16: | ||||||||||||||||||||||||||||||||||||||||||||
| var value int64 | ||||||||||||||||||||||||||||||||||||||||||||
| var err error | ||||||||||||||||||||||||||||||||||||||||||||
| if tags.defaultValue != "" { | ||||||||||||||||||||||||||||||||||||||||||||
| value, err = strconv.ParseInt(tags.defaultValue, 10, 64) | ||||||||||||||||||||||||||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||||||||||||||||||||||||||
| return fmt.Errorf("failed to parse int value %s for field %s: %w", tags.defaultValue, field.Name, err) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| flag = &cli.Int16Flag{ | ||||||||||||||||||||||||||||||||||||||||||||
| Name: flagName, | ||||||||||||||||||||||||||||||||||||||||||||
| Aliases: tags.aliases, | ||||||||||||||||||||||||||||||||||||||||||||
| Usage: tags.help, | ||||||||||||||||||||||||||||||||||||||||||||
| DefaultText: tags.defaultValue, | ||||||||||||||||||||||||||||||||||||||||||||
| Value: int16(value), //nolint: gosec | ||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incorrect conversion between integer types High
Incorrect conversion of a signed 64-bit integer from
strconv.ParseInt Error loading related location Loading
Copilot AutofixAI 12 months ago To fix the issue, we need to add explicit bounds checking before converting the The changes will be made in the
Suggested changeset
1
config.go
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||||||||||||||
| Sources: sources, | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| apply = func(cmd *cli.Command) { | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetInt(cmd.Int(flagName)) | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetInt(int64(cmd.Int16(flagName))) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Int32: | ||||||||||||||||||||||||||||||||||||||||||||
| var value int64 | ||||||||||||||||||||||||||||||||||||||||||||
| var err error | ||||||||||||||||||||||||||||||||||||||||||||
| if tags.defaultValue != "" { | ||||||||||||||||||||||||||||||||||||||||||||
| value, err = strconv.ParseInt(tags.defaultValue, 10, 64) | ||||||||||||||||||||||||||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||||||||||||||||||||||||||
| return fmt.Errorf("failed to parse int value %s for field %s: %w", tags.defaultValue, field.Name, err) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| flag = &cli.Int32Flag{ | ||||||||||||||||||||||||||||||||||||||||||||
| Name: flagName, | ||||||||||||||||||||||||||||||||||||||||||||
| Aliases: tags.aliases, | ||||||||||||||||||||||||||||||||||||||||||||
| Usage: tags.help, | ||||||||||||||||||||||||||||||||||||||||||||
| DefaultText: tags.defaultValue, | ||||||||||||||||||||||||||||||||||||||||||||
| Value: int32(value), //nolint: gosec | ||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incorrect conversion between integer types High
Incorrect conversion of a signed 64-bit integer from
strconv.ParseInt Error loading related location Loading Copilot AutofixAI 12 months ago Copilot could not generate an autofix suggestion Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support. |
||||||||||||||||||||||||||||||||||||||||||||
| Sources: sources, | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| apply = func(cmd *cli.Command) { | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetInt(int64(cmd.Int32(flagName))) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Int64: | ||||||||||||||||||||||||||||||||||||||||||||
| if _, ok := fieldValue.Interface().(time.Duration); ok { // special handling for time.Duration, which is a int64 | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -140,7 +199,7 @@ | |||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| flag = &cli.IntFlag{ | ||||||||||||||||||||||||||||||||||||||||||||
| flag = &cli.Int64Flag{ | ||||||||||||||||||||||||||||||||||||||||||||
| Name: flagName, | ||||||||||||||||||||||||||||||||||||||||||||
| Aliases: tags.aliases, | ||||||||||||||||||||||||||||||||||||||||||||
| Usage: tags.help, | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -149,10 +208,10 @@ | |||||||||||||||||||||||||||||||||||||||||||
| Sources: sources, | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| apply = func(cmd *cli.Command) { | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetInt(cmd.Int(flagName)) | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetInt(cmd.Int64(flagName)) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Uint: | ||||||||||||||||||||||||||||||||||||||||||||
| var value uint64 | ||||||||||||||||||||||||||||||||||||||||||||
| var err error | ||||||||||||||||||||||||||||||||||||||||||||
| if tags.defaultValue != "" { | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -163,6 +222,90 @@ | |||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| flag = &cli.UintFlag{ | ||||||||||||||||||||||||||||||||||||||||||||
| Name: flagName, | ||||||||||||||||||||||||||||||||||||||||||||
| Aliases: tags.aliases, | ||||||||||||||||||||||||||||||||||||||||||||
| Usage: tags.help, | ||||||||||||||||||||||||||||||||||||||||||||
| DefaultText: tags.defaultValue, | ||||||||||||||||||||||||||||||||||||||||||||
| Value: uint(value), | ||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incorrect conversion between integer types High
Incorrect conversion of an unsigned 64-bit integer from
strconv.ParseUint Error loading related location Loading
Copilot AutofixAI 12 months ago To fix the issue, we need to ensure that the parsed
The fix will involve modifying the code around line 229 to include the upper bound check.
Suggested changeset
1
config.go
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||||||||||||||
| Sources: sources, | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| apply = func(cmd *cli.Command) { | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetUint(uint64(cmd.Uint(flagName))) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Uint8: | ||||||||||||||||||||||||||||||||||||||||||||
| var value uint64 | ||||||||||||||||||||||||||||||||||||||||||||
| var err error | ||||||||||||||||||||||||||||||||||||||||||||
| if tags.defaultValue != "" { | ||||||||||||||||||||||||||||||||||||||||||||
| value, err = strconv.ParseUint(tags.defaultValue, 10, 64) | ||||||||||||||||||||||||||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||||||||||||||||||||||||||
| return fmt.Errorf("failed to parse uint value %s for field %s: %w", tags.defaultValue, field.Name, err) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| flag = &cli.Uint8Flag{ | ||||||||||||||||||||||||||||||||||||||||||||
| Name: flagName, | ||||||||||||||||||||||||||||||||||||||||||||
| Aliases: tags.aliases, | ||||||||||||||||||||||||||||||||||||||||||||
| Usage: tags.help, | ||||||||||||||||||||||||||||||||||||||||||||
| DefaultText: tags.defaultValue, | ||||||||||||||||||||||||||||||||||||||||||||
| Value: uint8(value), //nolint: gosec | ||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incorrect conversion between integer types High
Incorrect conversion of an unsigned 64-bit integer from
strconv.ParseUint Error loading related location Loading
Copilot AutofixAI 12 months ago To fix the issue, we need to add an upper bound check before converting the
This ensures that the conversion is safe and prevents unexpected truncation of values.
Suggested changeset
1
config.go
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||||||||||||||
| Sources: sources, | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| apply = func(cmd *cli.Command) { | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetUint(uint64(cmd.Uint8(flagName))) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Uint16: | ||||||||||||||||||||||||||||||||||||||||||||
| var value uint64 | ||||||||||||||||||||||||||||||||||||||||||||
| var err error | ||||||||||||||||||||||||||||||||||||||||||||
| if tags.defaultValue != "" { | ||||||||||||||||||||||||||||||||||||||||||||
| value, err = strconv.ParseUint(tags.defaultValue, 10, 64) | ||||||||||||||||||||||||||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||||||||||||||||||||||||||
| return fmt.Errorf("failed to parse uint value %s for field %s: %w", tags.defaultValue, field.Name, err) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| flag = &cli.Uint16Flag{ | ||||||||||||||||||||||||||||||||||||||||||||
| Name: flagName, | ||||||||||||||||||||||||||||||||||||||||||||
| Aliases: tags.aliases, | ||||||||||||||||||||||||||||||||||||||||||||
| Usage: tags.help, | ||||||||||||||||||||||||||||||||||||||||||||
| DefaultText: tags.defaultValue, | ||||||||||||||||||||||||||||||||||||||||||||
| Value: uint16(value), //nolint: gosec | ||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incorrect conversion between integer types High
Incorrect conversion of an unsigned 64-bit integer from
strconv.ParseUint Error loading related location Loading
Copilot AutofixAI 12 months ago To fix the issue, we need to ensure that the value parsed from The changes will be made in the
Suggested changeset
1
config.go
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||||||||||||||
| Sources: sources, | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| apply = func(cmd *cli.Command) { | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetUint(uint64(cmd.Uint16(flagName))) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Uint32: | ||||||||||||||||||||||||||||||||||||||||||||
| var value uint64 | ||||||||||||||||||||||||||||||||||||||||||||
| var err error | ||||||||||||||||||||||||||||||||||||||||||||
| if tags.defaultValue != "" { | ||||||||||||||||||||||||||||||||||||||||||||
| value, err = strconv.ParseUint(tags.defaultValue, 10, 64) | ||||||||||||||||||||||||||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||||||||||||||||||||||||||
| return fmt.Errorf("failed to parse uint value %s for field %s: %w", tags.defaultValue, field.Name, err) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| flag = &cli.Uint32Flag{ | ||||||||||||||||||||||||||||||||||||||||||||
| Name: flagName, | ||||||||||||||||||||||||||||||||||||||||||||
| Aliases: tags.aliases, | ||||||||||||||||||||||||||||||||||||||||||||
| Usage: tags.help, | ||||||||||||||||||||||||||||||||||||||||||||
| DefaultText: tags.defaultValue, | ||||||||||||||||||||||||||||||||||||||||||||
| Value: uint32(value), //nolint: gosec | ||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Incorrect conversion between integer types High
Incorrect conversion of an unsigned 64-bit integer from
strconv.ParseUint Error loading related location Loading
Copilot AutofixAI 12 months ago To fix the issue, we need to ensure that the value parsed by The fix involves:
Suggested changeset
1
config.go
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||||||||||||||
| Sources: sources, | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| apply = func(cmd *cli.Command) { | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetUint(uint64(cmd.Uint32(flagName))) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Uint64: | ||||||||||||||||||||||||||||||||||||||||||||
| var value uint64 | ||||||||||||||||||||||||||||||||||||||||||||
| var err error | ||||||||||||||||||||||||||||||||||||||||||||
| if tags.defaultValue != "" { | ||||||||||||||||||||||||||||||||||||||||||||
| value, err = strconv.ParseUint(tags.defaultValue, 10, 64) | ||||||||||||||||||||||||||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||||||||||||||||||||||||||
| return fmt.Errorf("failed to parse uint value %s for field %s: %w", tags.defaultValue, field.Name, err) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| flag = &cli.Uint64Flag{ | ||||||||||||||||||||||||||||||||||||||||||||
| Name: flagName, | ||||||||||||||||||||||||||||||||||||||||||||
| Aliases: tags.aliases, | ||||||||||||||||||||||||||||||||||||||||||||
| Usage: tags.help, | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -171,9 +314,30 @@ | |||||||||||||||||||||||||||||||||||||||||||
| Sources: sources, | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| apply = func(cmd *cli.Command) { | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetUint(cmd.Uint(flagName)) | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetUint(cmd.Uint64(flagName)) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Float32: | ||||||||||||||||||||||||||||||||||||||||||||
| var value float64 | ||||||||||||||||||||||||||||||||||||||||||||
| var err error | ||||||||||||||||||||||||||||||||||||||||||||
| if tags.defaultValue != "" { | ||||||||||||||||||||||||||||||||||||||||||||
| value, err = strconv.ParseFloat(tags.defaultValue, 64) | ||||||||||||||||||||||||||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||||||||||||||||||||||||||
| return fmt.Errorf("failed to parse float value %s for field %s: %w", tags.defaultValue, field.Name, err) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| flag = &cli.Float32Flag{ | ||||||||||||||||||||||||||||||||||||||||||||
| Name: flagName, | ||||||||||||||||||||||||||||||||||||||||||||
| Aliases: tags.aliases, | ||||||||||||||||||||||||||||||||||||||||||||
| Usage: tags.help, | ||||||||||||||||||||||||||||||||||||||||||||
| DefaultText: tags.defaultValue, | ||||||||||||||||||||||||||||||||||||||||||||
| Value: float32(value), | ||||||||||||||||||||||||||||||||||||||||||||
| Sources: sources, | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| apply = func(cmd *cli.Command) { | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetFloat(float64(cmd.Float32(flagName))) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Float32, reflect.Float64: | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Float64: | ||||||||||||||||||||||||||||||||||||||||||||
| var value float64 | ||||||||||||||||||||||||||||||||||||||||||||
| var err error | ||||||||||||||||||||||||||||||||||||||||||||
| if tags.defaultValue != "" { | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -183,7 +347,7 @@ | |||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| flag = &cli.FloatFlag{ | ||||||||||||||||||||||||||||||||||||||||||||
| flag = &cli.Float64Flag{ | ||||||||||||||||||||||||||||||||||||||||||||
| Name: flagName, | ||||||||||||||||||||||||||||||||||||||||||||
| Aliases: tags.aliases, | ||||||||||||||||||||||||||||||||||||||||||||
| Usage: tags.help, | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -192,7 +356,7 @@ | |||||||||||||||||||||||||||||||||||||||||||
| Sources: sources, | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| apply = func(cmd *cli.Command) { | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetFloat(cmd.Float(flagName)) | ||||||||||||||||||||||||||||||||||||||||||||
| fieldValue.SetFloat(cmd.Float64(flagName)) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| case reflect.Bool: | ||||||||||||||||||||||||||||||||||||||||||||
| var value bool | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
Check failure
Code scanning / CodeQL
Incorrect conversion between integer types High
Copilot Autofix
AI 12 months ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.