alecthomas / kong

Kong is a command-line parser for Go
MIT License
2.09k stars 138 forks source link

multiple set vs staticheck #440

Closed caarlos0 closed 2 months ago

caarlos0 commented 2 months ago

staticcheck complain about this:

type Options struct {
  Foo Foo `set:"x=z" set:"a=b"`
}

Should we maybe support something like this?

type Options struct {
  Foo Foo `set:"x=z,a=b"`
}
alecthomas commented 2 months ago

I don't think that can be achieved in a backwards compatible manner. The value is "anything after the =", so there'd be no way to determine if a separator should be adhered to or not.

caarlos0 commented 2 months ago

yeah, I think it would have to be a breaking change... not sure if its worth it, but I thought I would raise the question.

in the end, it's not that much of an issue anyway 🤔

alecthomas commented 2 months ago

I don't think this is worth it, especially as it would be impossible to provide a check that would notify the user.