mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-26 21:22:16 +08:00
remove unused method.
This commit is contained in:
parent
744b3e9e6e
commit
a8c11c557c
@ -41,23 +41,3 @@ func loadConfig(path string, envPrefix string, config any) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func loadConfigK8s(mountPath string, envPrefix string, config any) error {
|
||||
// configFilePath := filepath.Join(mountPath, configFileName)
|
||||
v := viper.New()
|
||||
v.SetConfigFile(mountPath)
|
||||
v.SetEnvPrefix(envPrefix)
|
||||
v.AutomaticEnv()
|
||||
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
|
||||
|
||||
if err := v.ReadInConfig(); err != nil {
|
||||
return errs.WrapMsg(err, "failed to read config file", "path", mountPath, "envPrefix", envPrefix)
|
||||
}
|
||||
|
||||
if err := v.Unmarshal(config, func(config *mapstructure.DecoderConfig) {
|
||||
config.TagName = "mapstructure"
|
||||
}); err != nil {
|
||||
return errs.WrapMsg(err, "failed to unmarshal config", "path", mountPath, "envPrefix", envPrefix)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user