Skip to content
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

Provide cmd.Int() and cmd.Int64() variants #2038

Closed
3 tasks done
volodymyrprokopyuk opened this issue Jan 3, 2025 · 2 comments
Closed
3 tasks done

Provide cmd.Int() and cmd.Int64() variants #2038

volodymyrprokopyuk opened this issue Jan 3, 2025 · 2 comments
Labels
area/v3 relates to / is being considered for v3 status/triage maintainers still need to look into this

Comments

@volodymyrprokopyuk
Copy link

Checklist

  • Are you running the latest v3 release? The list of releases is here.
  • Did you check the manual for your release? The v3 manual is here.
  • Did you perform a search about this feature? Here's the GitHub guide about searching.

What problem does this solve?

Currently only the var flag int = int(cmd.Int("flag")) # int64 is supported. That forces explicit conversions int(flag).

Solution description

Support all Go primitive types e.g. int, int64, float32, float64 when retrieving flag values from a command, in order avoid explicit conversions.

Describe alternatives you've considered

Otherwise, explicit conversions must be applied e.g. int(flag)

@volodymyrprokopyuk volodymyrprokopyuk added area/v3 relates to / is being considered for v3 status/triage maintainers still need to look into this labels Jan 3, 2025
@dearchap
Copy link
Contributor

dearchap commented Jan 5, 2025

@volodymyrprokopyuk There is a reason we have only 64 bit types. See #1765 , #1759

@volodymyrprokopyuk
Copy link
Author

volodymyrprokopyuk commented Jan 6, 2025

Reduction of the library surface area and the testing volume in expense of DX may be not the best decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v3 relates to / is being considered for v3 status/triage maintainers still need to look into this
Projects
None yet
Development

No branches or pull requests

2 participants