[#493] node/config: Change Sub implementation
In some cases viper doesn't interpret `section.value` as a subsection with `section` name, but value is value still can be accessed through full pathname. Fix `Config.Sub` method implementation in order to always interpret configuration like described above as a subsection. From now method never returns nil, therefore an additional check has been removed from the `Value` method. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
e5c014bbfb
commit
1aa88159ca
3 changed files with 17 additions and 15 deletions
|
@ -21,9 +21,6 @@ func TestConfigCommon(t *testing.T) {
|
|||
|
||||
const nonExistentSub = "non-existent sub-section"
|
||||
|
||||
sub = c.Sub(nonExistentSub)
|
||||
require.Nil(t, sub)
|
||||
|
||||
val = c.Sub(nonExistentSub).Value("value")
|
||||
require.Nil(t, val)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue