From 98ff16df38b92e9b0a34fbaf464792656f8ab5de Mon Sep 17 00:00:00 2001 From: eeeXun Date: Tue, 25 Oct 2022 01:01:50 +0800 Subject: [PATCH] fix: Getenv XDG_CONFIG_HOME Getenv don't need `$` sign --- config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.go b/config.go index 351f65b..9316a23 100644 --- a/config.go +++ b/config.go @@ -10,8 +10,8 @@ func configInit() { config.SetConfigName("gtt") config.SetConfigType("yaml") - if len(os.Getenv("$XDG_CONFIG_HOME")) > 0 { - defaultConfigPath = os.Getenv("$XDG_CONFIG_HOME") + "/gtt" + if len(os.Getenv("XDG_CONFIG_HOME")) > 0 { + defaultConfigPath = os.Getenv("XDG_CONFIG_HOME") + "/gtt" config.AddConfigPath(defaultConfigPath) } else { defaultConfigPath = os.Getenv("HOME") + "/.config/gtt"