[WIP]: Fix Unmarshalling when only PFlags or Envs are set#766
[WIP]: Fix Unmarshalling when only PFlags or Envs are set#766inkychris wants to merge 1 commit intospf13:masterfrom inkychris:673-pflag-fix
Conversation
|
Thanks for the PR! Checking pflag is not enough IMHO. The same issue will cause |
…PFlags and Envs, unlike IsSet() (#764)
|
I'm not seeing the same behaviour for I can add the tests for |
|
Indeed, you are right. :) Here is a breaking test though: Flags and env vars generally override config entries. This is a tough scenario, because keys are not identical in this case. |
|
I'm afraid that any breaking change will cause trouble since this library is widely used. I hope we can clear things up a bit in a v2, but for now, I think reverting and allowing to set the key delimiter is a better option. |
Fixes #764 - Regression introduced by #673
The
keyComponents()function was using theGet()method in a way similar to howIsSet()works. Neither of these were returning in the expected way for partial keys when only pflags had been bound.