-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix EnumVarP func to show default value associated with EnumVariable … #106
Conversation
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.
lgtm!
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.
suggesting stricter check on enum values
@Mzack9999 , what do you thing about changing default value type and AllowedTypes? Current ImplementationflagSet.EnumVarP(&options.ScanStrategy, "scan-strategy", "ss", goflags.EnumVariable(0), "strategy to use while scanning(auto/host-spray/template-spray)", goflags.AllowdTypes{
"auto": goflags.EnumVariable(0),
"host-spray": goflags.EnumVariable(1),
"template-spray": goflags.EnumVariable(2),
}) New ImplementationflagSet.EnumVarP(&options.ScanStrategy, "scan-strategy", "ss", "auto", "strategy to use while scanning(auto/host-spray/template-spray)", []string{"auto","host-spray","template-spray"} we will use if _,ok:= AllowedTypes[defaultValue]; !ok{
panic(fmt.Errof("%v does not belong to %v",defaultValue,AllowedTypes))
} |
@tarunKoyalwar That's what I was discussing with @RamanaReddy0M , I think anyway that a |
…(#104)