-
Notifications
You must be signed in to change notification settings - Fork 568
feat(templates): set varargs in autocli config when needed #4624
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
Conversation
for _, field := range f { | ||
for i, field := range f { | ||
// only the last field can be a variadic field | ||
if i == len(f)-1 && field.IsSlice() { |
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.
Do we need to add the coins only as the last argument? Will the message not support a two-coin slice?
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.
Yes, that's correct, only one slice argument is supported. If you need multiple you should create a manual command
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.
may we should throw a warning or create a manual command in case the user tries to scaffold the slice of coins:
ignite s list employee bonus:coins salary:coins
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.
Creating a manual command for cases AutoCLI falls short would be a great feature yeah. I do not think we should have a warming however.
I can log an issue for that.
* feat(templates): set varargs in autocli config when needed * updates * fix (cherry picked from commit 7c53203) # Conflicts: # ignite/templates/field/fields.go # ignite/templates/typed/list/list.go # ignite/templates/typed/map/map.go # ignite/templates/typed/singleton/singleton.go
Closes: #4622