From 731a91be43e1a7cf5d090beafaa7ef0f55561119 Mon Sep 17 00:00:00 2001 From: Baruch Odem Date: Tue, 13 Jun 2023 11:04:31 +0300 Subject: [PATCH] feat: add func GetEnvPrefix --- viper.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/viper.go b/viper.go index 7fb1e19..0158a7f 100644 --- a/viper.go +++ b/viper.go @@ -523,6 +523,12 @@ func (v *Viper) SetEnvPrefix(in string) { } } +func GetEnvPrefix() string { return v.GetEnvPrefix() } + +func (v *Viper) GetEnvPrefix() string { + return v.envPrefix +} + func (v *Viper) mergeWithEnvPrefix(in string) string { if v.envPrefix != "" { return strings.ToUpper(v.envPrefix + "_" + in)