mirror of
https://github.com/spf13/viper
synced 2025-05-11 06:37:27 +00:00
Allow the key delimiter to be set on viper objects.
This commit is contained in:
parent
097e0d888f
commit
bb70192ffe
1 changed files with 8 additions and 0 deletions
8
viper.go
8
viper.go
|
@ -1478,6 +1478,14 @@ func (v *Viper) SetEnvKeyReplacer(r *strings.Replacer) {
|
||||||
v.envKeyReplacer = r
|
v.envKeyReplacer = r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetKeyDelim sets the delimiter used for determining key parts on the viper
|
||||||
|
// object.
|
||||||
|
func SetKeyDelim(d string) { v.SetKeyDelim(d) }
|
||||||
|
|
||||||
|
func (v *Viper) SetKeyDelim(d string) {
|
||||||
|
v.keyDelim = d
|
||||||
|
}
|
||||||
|
|
||||||
// RegisterAlias creates an alias that provides another accessor for the same key.
|
// RegisterAlias creates an alias that provides another accessor for the same key.
|
||||||
// This enables one to change a name without breaking the application.
|
// This enables one to change a name without breaking the application.
|
||||||
func RegisterAlias(alias string, key string) { v.RegisterAlias(alias, key) }
|
func RegisterAlias(alias string, key string) { v.RegisterAlias(alias, key) }
|
||||||
|
|
Loading…
Add table
Reference in a new issue