Skip to content

Commit

Permalink
fix viper interface
Browse files Browse the repository at this point in the history
  • Loading branch information
rsafonseca committed Feb 7, 2024
1 parent 79c183f commit 2e5c09e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions config/viper_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,42 +147,42 @@ func (c *Config) fillDefaultValues() {

// GetDuration returns a duration from the inner config
func (c *Config) GetDuration(s string) time.Duration {
return c.GetDuration(s)
return c.Viper.GetDuration(s)
}

// GetString returns a string from the inner config
func (c *Config) GetString(s string) string {
return c.GetString(s)
return c.Viper.GetString(s)
}

// GetInt returns an int from the inner config
func (c *Config) GetInt(s string) int {
return c.GetInt(s)
return c.Viper.GetInt(s)
}

// GetBool returns an boolean from the inner config
func (c *Config) GetBool(s string) bool {
return c.GetBool(s)
return c.Viper.GetBool(s)
}

// GetStringSlice returns a string slice from the inner config
func (c *Config) GetStringSlice(s string) []string {
return c.GetStringSlice(s)
return c.Viper.GetStringSlice(s)
}

// Get returns an interface from the inner config
func (c *Config) Get(s string) interface{} {
return c.Get(s)
return c.Viper.Get(s)
}

// GetStringMapString returns a string map string from the inner config
func (c *Config) GetStringMapString(s string) map[string]string {
return c.GetStringMapString(s)
return c.Viper.GetStringMapString(s)
}

// Unmarshal unmarshals config into v
func (c *Config) Unmarshal(v interface{}) error {
return c.Unmarshal(v)
return c.Viper.Unmarshal(v)
}

// UnmarshalKey unmarshals key into v
Expand Down Expand Up @@ -212,7 +212,7 @@ func (c *Config) UnmarshalKey(key string, rawVal interface{}) error {
}
i = val
}
return decode(i, defaultDecoderConfig(rawVal, opts...))
return decode(i, defaultDecoderConfig(rawVal))
}

func isStringMapInterface(val interface{}) bool {
Expand Down

0 comments on commit 2e5c09e

Please sign in to comment.