-
Notifications
You must be signed in to change notification settings - Fork 2k
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
viper.Sub() not extracting nested default values #747
Comments
pretty impressive this hasn't been fixed in 3 years and it seems like it doesn't impact many... |
When fetching a configuration sub-tree (either via Get() that results in a map, or through Sub()), ensure that any defaults for keys under that tree are propagated into the returned result. Fixes spf13#747 Signed-off-by: setrofim <setrofim@gmail.com>
I ran into related issue when Potential fix in #1439 (note: this technically changes existing expected behaviour -- see the updated |
Viper currently has a bug where defaults do not get properly propagated when extracting a configuration sub-tree. See spf13/viper#747 A pull request has been opened with a potential fix: spf13/viper#1439 Until the fix (or some alternative) gets merged, switch to using the forked version.
Viper currently has a bug where defaults do not get properly propagated when extracting a configuration sub-tree. See spf13/viper#747 A pull request has been opened with a potential fix: spf13/viper#1439 Until the fix (or some alternative) gets merged, switch to using the forked version.
Viper currently has a bug where defaults do not get properly propagated when extracting a configuration sub-tree. See spf13/viper#747 A pull request has been opened with a potential fix: spf13/viper#1439 Until the fix (or some alternative) gets merged, switch to using the forked version.
When fetching a configuration sub-tree (either via Get() that results in a map, or through Sub()), ensure that any defaults for keys under that tree are propagated into the returned result. Fixes spf13#747 Signed-off-by: setrofim <setrofim@gmail.com>
When fetching a configuration sub-tree (either via Get() that results in a map, or through Sub()), ensure that any defaults for keys under that tree are propagated into the returned result. Fixes spf13#747 Signed-off-by: setrofim <setrofim@gmail.com>
When fetching a configuration sub-tree (either via Get() that results in a map, or through Sub()), ensure that any defaults for keys under that tree are propagated into the returned result. Fixes spf13#747 Signed-off-by: setrofim <setrofim@gmail.com>
Viper currently has a bug where defaults do not get properly propagated when extracting a configuration sub-tree. See spf13/viper#747 A pull request has been opened with a potential fix: spf13/viper#1439 Until the fix (or some alternative) gets merged, switch to using the forked version.
Viper currently has a bug where defaults do not get properly propagated when extracting a configuration sub-tree. See spf13/viper#747 A pull request has been opened with a potential fix: spf13/viper#1439 Until the fix (or some alternative) gets merged, switch to using the forked version. Signed-off-by: Sergei Trofimov <sergei.trofimov@arm.com>
Viper currently has a bug where defaults do not get properly propagated when extracting a configuration sub-tree. See spf13/viper#747 A pull request has been opened with a potential fix: spf13/viper#1439 Until the fix (or some alternative) gets merged, switch to using the forked version. Signed-off-by: Sergei Trofimov <sergei.trofimov@arm.com>
Viper currently has a bug where defaults do not get properly propagated when extracting a configuration sub-tree. See spf13/viper#747 A pull request has been opened with a potential fix: spf13/viper#1439 Until the fix (or some alternative) gets merged, switch to using the forked version. Signed-off-by: Sergei Trofimov <sergei.trofimov@arm.com>
Viper currently has a bug where defaults do not get properly propagated when extracting a configuration sub-tree. See spf13/viper#747 A pull request has been opened with a potential fix: spf13/viper#1439 Until the fix (or some alternative) gets merged, switch to using the forked version. Signed-off-by: Sergei Trofimov <sergei.trofimov@arm.com>
Viper currently has a bug where defaults do not get properly propagated when extracting a configuration sub-tree. See spf13/viper#747 A pull request has been opened with a potential fix: spf13/viper#1439 Until the fix (or some alternative) gets merged, switch to using the forked version. Signed-off-by: Sergei Trofimov <sergei.trofimov@arm.com>
Viper currently has a bug where defaults do not get properly propagated when extracting a configuration sub-tree. See spf13/viper#747 A pull request has been opened with a potential fix: spf13/viper#1439 Until the fix (or some alternative) gets merged, switch to using the forked version. Signed-off-by: Sergei Trofimov <sergei.trofimov@arm.com>
Viper currently has a bug where defaults do not get properly propagated when extracting a configuration sub-tree. See spf13/viper#747 A pull request has been opened with a potential fix: spf13/viper#1439 Until the fix (or some alternative) gets merged, switch to using the forked version. Signed-off-by: Sergei Trofimov <sergei.trofimov@arm.com>
When fetching a configuration sub-tree (either via Get() that results in a map, or through Sub()), ensure that any defaults for keys under that tree are propagated into the returned result. Fixes spf13#747 Signed-off-by: setrofim <setrofim@gmail.com>
When fetching a configuration sub-tree (either via Get() that results in a map, or through Sub()), ensure that any defaults for keys under that tree are propagated into the returned result. Fixes spf13#747 Signed-off-by: setrofim <setrofim@gmail.com>
Viper currently has a bug where defaults do not get properly propagated when extracting a configuration sub-tree. See spf13/viper#747 A pull request has been opened with a potential fix: spf13/viper#1439 Until the fix (or some alternative) gets merged, switch to using the forked version. Signed-off-by: Sergei Trofimov <sergei.trofimov@arm.com>
I noticed an issue where viper.Sub() fails to extract default values of a nested key. I attached demo code to reproduce the issue using latest viper and Go 1.12.6 under x64_linux.
main.go
:demo.yaml
(works as inteded, but defaults are useless since everything is explicitly set):demo.yaml
(broken):Output for the broken example:
Whereas I would expect to have
value2.internal: 3
The issue seems somehow related / similar to issue #71 as well as PR #195
The text was updated successfully, but these errors were encountered: