Moved config set/unset to internal/config/modify.go as Store and Purge.

This commit is contained in:
bwilliams committed 2026-10-09 17:07:06 +01:00
1 parent 539e88e73c
commit 09644d0691
4 files changed
+102 -67

No files matched your search

+7 -3
View File
@@ -54,16 +54,20 @@ func LoadFromViper(conf *JobSearchConfig) {
if keyType == reflect.Invalid {
continue
}
var err error
switch keyType {
case reflect.String:
conf.SetValue(key, viper.GetString(key))
err = conf.SetValue(key, viper.GetString(key))
case reflect.Int:
conf.SetValue(key, viper.GetInt(key))
err = conf.SetValue(key, viper.GetInt(key))
case reflect.Bool:
conf.SetValue(key, viper.GetBool(key))
err = conf.SetValue(key, viper.GetBool(key))
default:
slog.Error(fmt.Sprintf("unknown key type: %s", keyType))
}
if err != nil {
slog.Warn("ignoring invalid config value", "key", key, "err", err)
}
}
}