From 05afd348d0fdfea7221e050a9a3ff05128948fc9 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 26 Oct 2019 22:16:37 -0400 Subject: [PATCH] Load default config first, so missing values remain default --- cmdConfig.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmdConfig.go b/cmdConfig.go index 64a14ee..8ed3098 100644 --- a/cmdConfig.go +++ b/cmdConfig.go @@ -53,6 +53,10 @@ func readConfig(filepath ...string) (*Config, error) { var configFile string var env bool + // Load default config first, this way any values missing from the provided config file will remain the default value + d := []byte(defaultConfig) + toml.Unmarshal(d, result) + switch len(filepath) { case 0: configFile, env = os.LookupEnv("KBTUI_CFG")