From 5036d0bca4d4438164d9241ff6b49168ebe79178 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 11 Feb 2024 14:50:53 -0500 Subject: [PATCH] feat: add SaveConfig --- config/config.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config/config.go b/config/config.go index 3d7b7ae..bb95129 100644 --- a/config/config.go +++ b/config/config.go @@ -103,3 +103,12 @@ func NewConfig(logger *zap.Logger) *Config { return c } + +func SaveConfig(cfg *Config) error { + err := viper.Unmarshal(cfg) + if err != nil { + return err + } + + return viper.WriteConfig() +}