This commit is contained in:
ljw
2024-09-13 22:39:00 +08:00
parent d9ed2127da
commit 3006f5bd7c
2 changed files with 19 additions and 3 deletions

View File

@@ -36,7 +36,7 @@ func Init(rowVal interface{}) *viper.Viper {
}
v := viper.New()
v.AutomaticEnv()
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_"))
v.SetEnvPrefix("RUSTDESK_API")
v.SetConfigFile(config)
v.SetConfigType("yaml")