From bb70192ffe36a63ed40c396cb9714dadac09d1fc Mon Sep 17 00:00:00 2001 From: Mark Fine Date: Wed, 5 Jul 2023 13:00:23 -0700 Subject: [PATCH] Allow the key delimiter to be set on viper objects. --- viper.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/viper.go b/viper.go index 0158a7f..e124790 100644 --- a/viper.go +++ b/viper.go @@ -1478,6 +1478,14 @@ func (v *Viper) SetEnvKeyReplacer(r *strings.Replacer) { 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. // This enables one to change a name without breaking the application. func RegisterAlias(alias string, key string) { v.RegisterAlias(alias, key) }