refactor: 使用 Viper 替换手动配置管理,支持原生热重载

This commit is contained in:
2026-03-02 01:56:08 +08:00
parent 1e4670cd26
commit dd55be6f5b
5 changed files with 130 additions and 152 deletions

View File

@@ -25,7 +25,7 @@ func main() {
initLogger()
slog.Info("VoicePaste", "version", version)
cfg := mustLoadConfig()
config.WatchAndReload("")
go config.WatchAndReload("")
initClipboard()
lanIPs := mustDetectLANIPs()
lanIP := lanIPs[0]