I have a IntSliceVar flag called groups. I can't seem to be able to pass empty slices in any way:
If I use --groups=[],
Error: invalid argument "[]" for "--groups" flag: strconv.Atoi: parsing "[]": invalid syntax
If I use --groups="",
Error: invalid argument "" for "--groups" flag: strconv.Atoi: parsing "": invalid syntax
Is there another syntax I'm missing?
This is part of a command-line program that uses cobra but I believe the problem to be within pflag (even though the error handling, that is printing the above errors and returning before I can get to my command handler, appears to be within cobra).
I have a IntSliceVar flag called
groups. I can't seem to be able to pass empty slices in any way:If I use
--groups=[],Error: invalid argument "[]" for "--groups" flag: strconv.Atoi: parsing "[]": invalid syntaxIf I use
--groups="",Error: invalid argument "" for "--groups" flag: strconv.Atoi: parsing "": invalid syntaxIs there another syntax I'm missing?
This is part of a command-line program that uses cobra but I believe the problem to be within pflag (even though the error handling, that is printing the above errors and returning before I can get to my command handler, appears to be within cobra).