feat: add SaveConfig
This commit is contained in:
parent
0365862777
commit
5036d0bca4
|
@ -103,3 +103,12 @@ func NewConfig(logger *zap.Logger) *Config {
|
||||||
|
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SaveConfig(cfg *Config) error {
|
||||||
|
err := viper.Unmarshal(cfg)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return viper.WriteConfig()
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue