-
Notifications
You must be signed in to change notification settings - Fork 712
chore : add the Validate and AddFlags() function
#1135
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Lavish Pal <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lavishpal The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Validate and AddFlags() functionValidate and AddFlags() function
|
/ok-to-test |
|
raised #1136 for fix the failing test |
| path := args[0] | ||
| buckets := args[1 : len(args)-1] | ||
| keyStr := args[len(args)-1] | ||
|
|
||
| key, err := parseBytes(keyStr, o.parseFormat) | ||
| if err != nil { | ||
| return err | ||
| } |
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.
This seems duplicated to the validate.
It is OK to add a separate AddFlags, but I do not see much value to add a separate Validate. Two proposals:
- [preferred] remove the
Validatemethod, do the validation in Run directly. - add the parsed arguments as fields in
getOptions, so thatRuncan use them directly.
This pr add the
ValidateandAddFlags()function in thecommand_get.gopart of #1026
ref comment