From 2537a7f49ac59a8376fe41c184524a1302a07c2a Mon Sep 17 00:00:00 2001 From: Ying Fan Chong Date: Sun, 4 Oct 2020 20:53:27 +0800 Subject: [PATCH] Fix config file path --- cfg/config_files.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cfg/config_files.go b/cfg/config_files.go index 184af654..cf65dec3 100644 --- a/cfg/config_files.go +++ b/cfg/config_files.go @@ -37,7 +37,7 @@ func CreateFile(fileName string) (string, error) { return "", err } - filePath := fmt.Sprintf("%s/%s", configDir, fileName) + filePath := filepath.Join(configDir, fileName) // Check if the file already exists; if it does not, create it _, err = os.Stat(filePath) @@ -106,7 +106,7 @@ func LoadWtfConfigFile(filePath string) *config.Config { // chmodConfigFile sets the mode of the config file to r+w for the owner only func chmodConfigFile() { configDir, _ := WtfConfigDir() - relPath := fmt.Sprintf("%s%s", configDir, WtfConfigFile) + relPath := filepath.Join(configDir, WtfConfigFile) absPath, _ := expandHomeDir(relPath) _, err := os.Stat(absPath)