-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
add Integer type casting when loading yaml file #1669
Conversation
@urfave/cli I am not watching it closely, but is there an API to type cast and report errors for just any type? The specificity of int64 sounds like something that should not come out of the box for generic command line handling library. |
@kjeom Can you add some tests in altsrc for this condition ? |
I didn't find the API. |
altsrc/map_input_source.go
Outdated
case reflect.Uint64: | ||
uint64Value := v.(uint64) | ||
if uint64Value <= math.MaxInt64 { | ||
int64Value = int64(uint64Value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test to update a test case to cover this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the patched code is covered.
@dearchap please finish your review |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/go-git/go-git/v5](https://togithub.com/go-git/go-git) | require | minor | `v5.5.2` -> `v5.6.0` | | [github.com/jedib0t/go-pretty/v6](https://togithub.com/jedib0t/go-pretty) | require | patch | `v6.4.4` -> `v6.4.6` | | [github.com/urfave/cli/v2](https://togithub.com/urfave/cli) | require | minor | `v2.24.4` -> `v2.25.0` | | [golang.org/x/exp](https://togithub.com/golang/exp) | require | digest | `c95f2b4` -> `9ff063c` | | [golang.org/x/mod](https://togithub.com/golang/mod) | require | minor | `v0.8.0` -> `v0.9.0` | | [golang.org/x/term](https://togithub.com/golang/term) | require | minor | `v0.5.0` -> `v0.6.0` | | [golang.org/x/tools](https://togithub.com/golang/tools) | require | minor | `v0.5.1-0.20230117180257-8aba49bb5ea2` -> `v0.6.0` | | [golang.org/x/vuln](https://togithub.com/golang/vuln) | require | digest | `4ec8867` -> `d3042fe` | --- ### Release Notes <details> <summary>go-git/go-git</summary> ### [`v5.6.0`](https://togithub.com/go-git/go-git/releases/tag/v5.6.0) [Compare Source](https://togithub.com/go-git/go-git/compare/v5.5.2...v5.6.0) #### What's Changed - Worktree, check for empty parent dirs during Reset (Fixes [#​670](https://togithub.com/go-git/go-git/issues/670)) by [@​mbohy](https://togithub.com/mbohy) in [https://github.com/go-git/go-git/pull/671](https://togithub.com/go-git/go-git/pull/671) - \*: remove need to build with CGO by [@​pjbgf](https://togithub.com/pjbgf) in [https://github.com/go-git/go-git/pull/688](https://togithub.com/go-git/go-git/pull/688) - plumbing: support SSH/X509 signed tags by [@​hiddeco](https://togithub.com/hiddeco) in [https://github.com/go-git/go-git/pull/690](https://togithub.com/go-git/go-git/pull/690) **Full Changelog**: go-git/go-git@v5.5.2...v5.6.0 </details> <details> <summary>jedib0t/go-pretty</summary> ### [`v6.4.6`](https://togithub.com/jedib0t/go-pretty/releases/tag/v6.4.6) [Compare Source](https://togithub.com/jedib0t/go-pretty/compare/v6.4.5...v6.4.6) ### Features - **table** - honor border color overrides for title row ([#​260](https://togithub.com/jedib0t/go-pretty/issues/260)) ### [`v6.4.5`](https://togithub.com/jedib0t/go-pretty/releases/tag/v6.4.5) [Compare Source](https://togithub.com/jedib0t/go-pretty/compare/v6.4.4...v6.4.5) ### Features - **table** - option to custom color borders/separators ([#​259](https://togithub.com/jedib0t/go-pretty/issues/259)) - `table.Style().Color.Border` - `table.Style().Color.Separator` - **text** - handle escape sequences that embed a URL ([#​256](https://togithub.com/jedib0t/go-pretty/issues/256)) // thanks [@​vsemichev](https://togithub.com/vsemichev) </details> <details> <summary>urfave/cli</summary> ### [`v2.25.0`](https://togithub.com/urfave/cli/releases/tag/v2.25.0) [Compare Source](https://togithub.com/urfave/cli/compare/v2.24.4...v2.25.0) #### What's Changed - Drop support for Go versions before 1.18 by [@​meatballhat](https://togithub.com/meatballhat) in [https://github.com/urfave/cli/pull/1667](https://togithub.com/urfave/cli/pull/1667) - add Integer type casting when loading yaml file by [@​kjeom](https://togithub.com/kjeom) in [https://github.com/urfave/cli/pull/1669](https://togithub.com/urfave/cli/pull/1669) #### New Contributors - [@​kjeom](https://togithub.com/kjeom) made their first contribution in [https://github.com/urfave/cli/pull/1669](https://togithub.com/urfave/cli/pull/1669) **Full Changelog**: urfave/cli@v2.24.4...v2.25.0 </details> <details> <summary>golang/mod</summary> ### [`v0.9.0`](https://togithub.com/golang/mod/compare/v0.8.0...v0.9.0) [Compare Source](https://togithub.com/golang/mod/compare/v0.8.0...v0.9.0) </details> <details> <summary>golang/term</summary> ### [`v0.6.0`](https://togithub.com/golang/term/compare/v0.5.0...v0.6.0) [Compare Source](https://togithub.com/golang/term/compare/v0.5.0...v0.6.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 6am on monday" in timezone Australia/Sydney, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/google/osv-scanner). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNDYuMiIsInVwZGF0ZWRJblZlciI6IjM0LjE0Ni4yIn0=-->
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/go-git/go-git/v5](https://togithub.com/go-git/go-git) | require | minor | `v5.5.2` -> `v5.6.0` | | [github.com/jedib0t/go-pretty/v6](https://togithub.com/jedib0t/go-pretty) | require | patch | `v6.4.4` -> `v6.4.6` | | [github.com/urfave/cli/v2](https://togithub.com/urfave/cli) | require | minor | `v2.24.4` -> `v2.25.0` | | [golang.org/x/exp](https://togithub.com/golang/exp) | require | digest | `c95f2b4` -> `9ff063c` | | [golang.org/x/mod](https://togithub.com/golang/mod) | require | minor | `v0.8.0` -> `v0.9.0` | | [golang.org/x/term](https://togithub.com/golang/term) | require | minor | `v0.5.0` -> `v0.6.0` | | [golang.org/x/tools](https://togithub.com/golang/tools) | require | minor | `v0.5.1-0.20230117180257-8aba49bb5ea2` -> `v0.6.0` | | [golang.org/x/vuln](https://togithub.com/golang/vuln) | require | digest | `4ec8867` -> `d3042fe` | --- ### Release Notes <details> <summary>go-git/go-git</summary> ### [`v5.6.0`](https://togithub.com/go-git/go-git/releases/tag/v5.6.0) [Compare Source](https://togithub.com/go-git/go-git/compare/v5.5.2...v5.6.0) #### What's Changed - Worktree, check for empty parent dirs during Reset (Fixes [#​670](https://togithub.com/go-git/go-git/issues/670)) by [@​mbohy](https://togithub.com/mbohy) in [https://github.com/go-git/go-git/pull/671](https://togithub.com/go-git/go-git/pull/671) - \*: remove need to build with CGO by [@​pjbgf](https://togithub.com/pjbgf) in [https://github.com/go-git/go-git/pull/688](https://togithub.com/go-git/go-git/pull/688) - plumbing: support SSH/X509 signed tags by [@​hiddeco](https://togithub.com/hiddeco) in [https://github.com/go-git/go-git/pull/690](https://togithub.com/go-git/go-git/pull/690) **Full Changelog**: go-git/go-git@v5.5.2...v5.6.0 </details> <details> <summary>jedib0t/go-pretty</summary> ### [`v6.4.6`](https://togithub.com/jedib0t/go-pretty/releases/tag/v6.4.6) [Compare Source](https://togithub.com/jedib0t/go-pretty/compare/v6.4.5...v6.4.6) ### Features - **table** - honor border color overrides for title row ([#​260](https://togithub.com/jedib0t/go-pretty/issues/260)) ### [`v6.4.5`](https://togithub.com/jedib0t/go-pretty/releases/tag/v6.4.5) [Compare Source](https://togithub.com/jedib0t/go-pretty/compare/v6.4.4...v6.4.5) ### Features - **table** - option to custom color borders/separators ([#​259](https://togithub.com/jedib0t/go-pretty/issues/259)) - `table.Style().Color.Border` - `table.Style().Color.Separator` - **text** - handle escape sequences that embed a URL ([#​256](https://togithub.com/jedib0t/go-pretty/issues/256)) // thanks [@​vsemichev](https://togithub.com/vsemichev) </details> <details> <summary>urfave/cli</summary> ### [`v2.25.0`](https://togithub.com/urfave/cli/releases/tag/v2.25.0) [Compare Source](https://togithub.com/urfave/cli/compare/v2.24.4...v2.25.0) #### What's Changed - Drop support for Go versions before 1.18 by [@​meatballhat](https://togithub.com/meatballhat) in [https://github.com/urfave/cli/pull/1667](https://togithub.com/urfave/cli/pull/1667) - add Integer type casting when loading yaml file by [@​kjeom](https://togithub.com/kjeom) in [https://github.com/urfave/cli/pull/1669](https://togithub.com/urfave/cli/pull/1669) #### New Contributors - [@​kjeom](https://togithub.com/kjeom) made their first contribution in [https://github.com/urfave/cli/pull/1669](https://togithub.com/urfave/cli/pull/1669) **Full Changelog**: urfave/cli@v2.24.4...v2.25.0 </details> <details> <summary>golang/mod</summary> ### [`v0.9.0`](https://togithub.com/golang/mod/compare/v0.8.0...v0.9.0) [Compare Source](https://togithub.com/golang/mod/compare/v0.8.0...v0.9.0) </details> <details> <summary>golang/term</summary> ### [`v0.6.0`](https://togithub.com/golang/term/compare/v0.5.0...v0.6.0) [Compare Source](https://togithub.com/golang/term/compare/v0.5.0...v0.6.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 6am on monday" in timezone Australia/Sydney, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/google/osv-scanner). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNDYuMiIsInVwZGF0ZWRJblZlciI6IjM0LjE0Ni4yIn0=-->
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/go-git/go-git/v5](https://togithub.com/go-git/go-git) | require | minor | `v5.5.2` -> `v5.6.0` | | [github.com/jedib0t/go-pretty/v6](https://togithub.com/jedib0t/go-pretty) | require | patch | `v6.4.4` -> `v6.4.6` | | [github.com/urfave/cli/v2](https://togithub.com/urfave/cli) | require | minor | `v2.24.4` -> `v2.25.0` | | [golang.org/x/exp](https://togithub.com/golang/exp) | require | digest | `c95f2b4` -> `9ff063c` | | [golang.org/x/mod](https://togithub.com/golang/mod) | require | minor | `v0.8.0` -> `v0.9.0` | | [golang.org/x/term](https://togithub.com/golang/term) | require | minor | `v0.5.0` -> `v0.6.0` | | [golang.org/x/tools](https://togithub.com/golang/tools) | require | minor | `v0.5.1-0.20230117180257-8aba49bb5ea2` -> `v0.6.0` | | [golang.org/x/vuln](https://togithub.com/golang/vuln) | require | digest | `4ec8867` -> `d3042fe` | --- ### Release Notes <details> <summary>go-git/go-git</summary> ### [`v5.6.0`](https://togithub.com/go-git/go-git/releases/tag/v5.6.0) [Compare Source](https://togithub.com/go-git/go-git/compare/v5.5.2...v5.6.0) #### What's Changed - Worktree, check for empty parent dirs during Reset (Fixes [#​670](https://togithub.com/go-git/go-git/issues/670)) by [@​mbohy](https://togithub.com/mbohy) in [https://github.com/go-git/go-git/pull/671](https://togithub.com/go-git/go-git/pull/671) - \*: remove need to build with CGO by [@​pjbgf](https://togithub.com/pjbgf) in [https://github.com/go-git/go-git/pull/688](https://togithub.com/go-git/go-git/pull/688) - plumbing: support SSH/X509 signed tags by [@​hiddeco](https://togithub.com/hiddeco) in [https://github.com/go-git/go-git/pull/690](https://togithub.com/go-git/go-git/pull/690) **Full Changelog**: go-git/go-git@v5.5.2...v5.6.0 </details> <details> <summary>jedib0t/go-pretty</summary> ### [`v6.4.6`](https://togithub.com/jedib0t/go-pretty/releases/tag/v6.4.6) [Compare Source](https://togithub.com/jedib0t/go-pretty/compare/v6.4.5...v6.4.6) ### Features - **table** - honor border color overrides for title row ([#​260](https://togithub.com/jedib0t/go-pretty/issues/260)) ### [`v6.4.5`](https://togithub.com/jedib0t/go-pretty/releases/tag/v6.4.5) [Compare Source](https://togithub.com/jedib0t/go-pretty/compare/v6.4.4...v6.4.5) ### Features - **table** - option to custom color borders/separators ([#​259](https://togithub.com/jedib0t/go-pretty/issues/259)) - `table.Style().Color.Border` - `table.Style().Color.Separator` - **text** - handle escape sequences that embed a URL ([#​256](https://togithub.com/jedib0t/go-pretty/issues/256)) // thanks [@​vsemichev](https://togithub.com/vsemichev) </details> <details> <summary>urfave/cli</summary> ### [`v2.25.0`](https://togithub.com/urfave/cli/releases/tag/v2.25.0) [Compare Source](https://togithub.com/urfave/cli/compare/v2.24.4...v2.25.0) #### What's Changed - Drop support for Go versions before 1.18 by [@​meatballhat](https://togithub.com/meatballhat) in [https://github.com/urfave/cli/pull/1667](https://togithub.com/urfave/cli/pull/1667) - add Integer type casting when loading yaml file by [@​kjeom](https://togithub.com/kjeom) in [https://github.com/urfave/cli/pull/1669](https://togithub.com/urfave/cli/pull/1669) #### New Contributors - [@​kjeom](https://togithub.com/kjeom) made their first contribution in [https://github.com/urfave/cli/pull/1669](https://togithub.com/urfave/cli/pull/1669) **Full Changelog**: urfave/cli@v2.24.4...v2.25.0 </details> <details> <summary>golang/mod</summary> ### [`v0.9.0`](https://togithub.com/golang/mod/compare/v0.8.0...v0.9.0) [Compare Source](https://togithub.com/golang/mod/compare/v0.8.0...v0.9.0) </details> <details> <summary>golang/term</summary> ### [`v0.6.0`](https://togithub.com/golang/term/compare/v0.5.0...v0.6.0) [Compare Source](https://togithub.com/golang/term/compare/v0.5.0...v0.6.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 6am on monday" in timezone Australia/Sydney, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/google/osv-scanner). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNDYuMiIsInVwZGF0ZWRJblZlciI6IjM0LjE0Ni4yIn0=-->
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/go-git/go-git/v5](https://togithub.com/go-git/go-git) | require | minor | `v5.5.2` -> `v5.6.0` | | [github.com/jedib0t/go-pretty/v6](https://togithub.com/jedib0t/go-pretty) | require | patch | `v6.4.4` -> `v6.4.6` | | [github.com/urfave/cli/v2](https://togithub.com/urfave/cli) | require | minor | `v2.24.4` -> `v2.25.0` | | [golang.org/x/exp](https://togithub.com/golang/exp) | require | digest | `c95f2b4` -> `9ff063c` | | [golang.org/x/mod](https://togithub.com/golang/mod) | require | minor | `v0.8.0` -> `v0.9.0` | | [golang.org/x/term](https://togithub.com/golang/term) | require | minor | `v0.5.0` -> `v0.6.0` | | [golang.org/x/tools](https://togithub.com/golang/tools) | require | minor | `v0.5.1-0.20230117180257-8aba49bb5ea2` -> `v0.6.0` | | [golang.org/x/vuln](https://togithub.com/golang/vuln) | require | digest | `4ec8867` -> `d3042fe` | --- ### Release Notes <details> <summary>go-git/go-git</summary> ### [`v5.6.0`](https://togithub.com/go-git/go-git/releases/tag/v5.6.0) [Compare Source](https://togithub.com/go-git/go-git/compare/v5.5.2...v5.6.0) #### What's Changed - Worktree, check for empty parent dirs during Reset (Fixes [#​670](https://togithub.com/go-git/go-git/issues/670)) by [@​mbohy](https://togithub.com/mbohy) in [https://github.com/go-git/go-git/pull/671](https://togithub.com/go-git/go-git/pull/671) - \*: remove need to build with CGO by [@​pjbgf](https://togithub.com/pjbgf) in [https://github.com/go-git/go-git/pull/688](https://togithub.com/go-git/go-git/pull/688) - plumbing: support SSH/X509 signed tags by [@​hiddeco](https://togithub.com/hiddeco) in [https://github.com/go-git/go-git/pull/690](https://togithub.com/go-git/go-git/pull/690) **Full Changelog**: go-git/go-git@v5.5.2...v5.6.0 </details> <details> <summary>jedib0t/go-pretty</summary> ### [`v6.4.6`](https://togithub.com/jedib0t/go-pretty/releases/tag/v6.4.6) [Compare Source](https://togithub.com/jedib0t/go-pretty/compare/v6.4.5...v6.4.6) ### Features - **table** - honor border color overrides for title row ([#​260](https://togithub.com/jedib0t/go-pretty/issues/260)) ### [`v6.4.5`](https://togithub.com/jedib0t/go-pretty/releases/tag/v6.4.5) [Compare Source](https://togithub.com/jedib0t/go-pretty/compare/v6.4.4...v6.4.5) ### Features - **table** - option to custom color borders/separators ([#​259](https://togithub.com/jedib0t/go-pretty/issues/259)) - `table.Style().Color.Border` - `table.Style().Color.Separator` - **text** - handle escape sequences that embed a URL ([#​256](https://togithub.com/jedib0t/go-pretty/issues/256)) // thanks [@​vsemichev](https://togithub.com/vsemichev) </details> <details> <summary>urfave/cli</summary> ### [`v2.25.0`](https://togithub.com/urfave/cli/releases/tag/v2.25.0) [Compare Source](https://togithub.com/urfave/cli/compare/v2.24.4...v2.25.0) #### What's Changed - Drop support for Go versions before 1.18 by [@​meatballhat](https://togithub.com/meatballhat) in [https://github.com/urfave/cli/pull/1667](https://togithub.com/urfave/cli/pull/1667) - add Integer type casting when loading yaml file by [@​kjeom](https://togithub.com/kjeom) in [https://github.com/urfave/cli/pull/1669](https://togithub.com/urfave/cli/pull/1669) #### New Contributors - [@​kjeom](https://togithub.com/kjeom) made their first contribution in [https://github.com/urfave/cli/pull/1669](https://togithub.com/urfave/cli/pull/1669) **Full Changelog**: urfave/cli@v2.24.4...v2.25.0 </details> <details> <summary>golang/mod</summary> ### [`v0.9.0`](https://togithub.com/golang/mod/compare/v0.8.0...v0.9.0) [Compare Source](https://togithub.com/golang/mod/compare/v0.8.0...v0.9.0) </details> <details> <summary>golang/term</summary> ### [`v0.6.0`](https://togithub.com/golang/term/compare/v0.5.0...v0.6.0) [Compare Source](https://togithub.com/golang/term/compare/v0.5.0...v0.6.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 6am on monday" in timezone Australia/Sydney, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/google/osv-scanner). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNDYuMiIsInVwZGF0ZWRJblZlciI6IjM0LjE0Ni4yIn0=-->
What type of PR is this?
(REQUIRED)
What this PR does / why we need it:
(REQUIRED)
9223372036854775807
regardless of the flag typetrue
after loaded from yaml about all the flags except the slice flagstrue
about slice flag type alsoWhich issue(s) this PR fixes:
(REQUIRED)
Special notes for your reviewer:
(fill-in or delete this section)
Testing
(fill-in or delete this section)
Release Notes
(REQUIRED)