From 82bb145cbc0f215f3c97a840f9b7345b4d84f3b2 Mon Sep 17 00:00:00 2001 From: Hunman Date: Fri, 30 Dec 2022 00:17:38 +0100 Subject: [PATCH] Move the global config path into a variable --- config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index 1d95a50..2375cb2 100644 --- a/config.go +++ b/config.go @@ -16,6 +16,8 @@ import ( var cfgDir string func init() { + etcPath := "/etc/itd.toml"; + // Set up logger log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}) @@ -52,7 +54,7 @@ func init() { setCfgDefaults() // Load config files - etcProvider := file.Provider("/etc/itd.toml") + etcProvider := file.Provider(etcPath) cfgProvider := file.Provider(cfgPath) k.Load(etcProvider, toml.Parser()) k.Load(cfgProvider, toml.Parser())