-
Notifications
You must be signed in to change notification settings - Fork 38
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
Create new string-enum[]
type
#677
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 other than please double-check with Chad on the log-format flag.
values := make([]string, 0, len(s.Allowed)) | ||
for _, v := range s.Allowed { | ||
values = append(values, v) | ||
} |
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.
just a suggestion if you like
values := make([]string, 0, len(s.Allowed)) | |
for _, v := range s.Allowed { | |
values = append(values, v) | |
} | |
values := maps.Values(s.Allowed) |
(from "golang.org/x/exp/maps"
)
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.
from "golang.org/x/exp/maps"
I think it's in the standard library now w/ the iter stuff (so not a slice necessarily)
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.
They didn't include Keys and Values from x/exp/maps in the stdlib package. I'm not sure why, they're pretty useful 🤷
Co-authored-by: David Reiss <dnr@dnr.im>
<!--- Note to EXTERNAL Contributors --> <!-- Thanks for opening a PR! If it is a significant code change, please **make sure there is an open issue** for this. We work best with you when we have accepted the idea first before you code. --> <!--- For ALL Contributors 👇 --> <!-- Describe what has changed in this PR --> Created a new `string-enum[]` type <!-- Tell your future self why have you made these changes --> Command option behavior already exists, there just wasn't a specific type for this yet. <!--- add/delete as needed ---> 1. Closes temporalio#670 2. How was this tested: <!--- Please describe how you tested your changes/how we can test them --> 3. Any docs updates needed? <!--- update README if applicable or point out where to update docs.temporal.io --> --------- Co-authored-by: David Reiss <dnr@dnr.im>
What was changed
Created a new
string-enum[]
typeWhy?
Command option behavior already exists, there just wasn't a specific type for this yet.
Checklist
Closes [Feature Request] Create new 'string-enum[]' type for the CLI command generation #670
How was this tested: