Preflight Checklist
Viper Version
1.21.0
Go Version
1.24
Config Source
Remove K/V stores
Format
YAML
Repl.it link
No response
Code reproducing the issue
|
// Config file next |
|
val = v.searchIndexableWithPathPrefixes(v.config, path) |
|
if val != nil { |
|
return val |
|
} |
|
if nested && v.isPathShadowedInDeepMap(path, v.config) != "" { |
|
return nil |
|
} |
|
|
|
// K/V store next |
|
val = v.searchMap(v.kvstore, path) |
|
if val != nil { |
|
return val |
|
} |
|
if nested && v.isPathShadowedInDeepMap(path, v.kvstore) != "" { |
|
return nil |
|
} |
Expected Behavior
The same unmarshal key behaviour between local and remote config.
Actual Behavior
unmarshal from remote config (kvstore) using searchMap which can't get value from slice index key path.
Steps To Reproduce
viper.Get("array.0") // local config get value 'a'
viper.Get("array.0") // remote config get value nil
Additional Information
No response
Preflight Checklist
Viper Version
1.21.0
Go Version
1.24
Config Source
Remove K/V stores
Format
YAML
Repl.it link
No response
Code reproducing the issue
viper/viper.go
Lines 1250 to 1266 in e66ee1a
Expected Behavior
The same unmarshal key behaviour between local and remote config.
Actual Behavior
unmarshal from remote config (kvstore) using
searchMapwhich can't get value from slice index key path.Steps To Reproduce
Additional Information
No response