We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
env
cmd
Hello all!
Playground demonstrating the issue: https://go.dev/play/p/LFPIRwbTCqc
If we had a struct like:
var CLI struct { One CmdOne `cmd:"" env:"CMD"` Two CmdTwo `cmd:"" env:"CMD"` }
Then env CMD=one cli still fails with expected one of "one", "two" which doesn't seem correct to me. Perhaps I'm missing something in the usage?
env CMD=one cli
expected one of "one", "two"
However, cli one or cli two works as expected.
cli one
cli two
Thanks for your time!
PS:
I know we can do something like this, but it seems to defeat the purpose of env:"X":
env:"X"
if cmd := os.Getenv("CMD"); cmd != "" { os.Args = append([]string{os.Args[0], cmd}, os.Args[1:]...) }
The text was updated successfully, but these errors were encountered:
If using env with cmd is not intended to be supported, could we get Kong to produce an error when both are specified?
Sorry, something went wrong.
env is not supported, correct. Kong currently doesn't error for any use of unsupported tags. I think doing that robustly would require some thought.
Ah, I haven't dug into the code, but sounds like it's more involved than just checking if cmd and env then error.
Thanks very much for the reply. Love the package!
No branches or pull requests
Hello all!
Playground demonstrating the issue: https://go.dev/play/p/LFPIRwbTCqc
If we had a struct like:
Then
env CMD=one cli
still fails withexpected one of "one", "two"
which doesn't seem correct to me. Perhaps I'm missing something in the usage?However,
cli one
orcli two
works as expected.Thanks for your time!
PS:
I know we can do something like this, but it seems to defeat the purpose of
env:"X"
:The text was updated successfully, but these errors were encountered: