Skip to content

Commit

Permalink
fix unmarshalkey
Browse files Browse the repository at this point in the history
  • Loading branch information
rsafonseca committed Feb 7, 2024
1 parent 2e5c09e commit bef71a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/viper_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewConfig(cfgs ...*viper.Viper) *Config {

cfg.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
cfg.AutomaticEnv()
c := &Config{cfg}
c := &Config{Viper: cfg}
c.fillDefaultValues()
return c
}
Expand Down Expand Up @@ -191,7 +191,7 @@ func (c *Config) UnmarshalKey(key string, rawVal interface{}) error {
delimiter := "."
prefix := key + delimiter

i := c.Get(key)
i := c.Viper.Get(key)
if isStringMapInterface(i) {
val := i.(map[string]interface{})
keys := c.AllKeys()
Expand Down

0 comments on commit bef71a0

Please sign in to comment.