From 28f5bdea8ea66b42c03444b6bdf1d89edff6f5f8 Mon Sep 17 00:00:00 2001 From: ffdfgdfg Date: Fri, 13 Dec 2019 23:06:15 +0800 Subject: [PATCH] fix config path --- gui/npc/npc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/npc/npc.go b/gui/npc/npc.go index b9761a9..46369ac 100644 --- a/gui/npc/npc.go +++ b/gui/npc/npc.go @@ -139,8 +139,8 @@ func saveConfig(host, vkey, connType string) { logs.Warn("not found config dir") return } - _ = os.Remove(ph + "npc.conf") - f, err := os.OpenFile(ph+"npc.conf", os.O_CREATE|os.O_WRONLY, 0644) + _ = os.Remove(path.Join(ph, "npc.conf")) + f, err := os.OpenFile(path.Join(ph, "npc.conf"), os.O_CREATE|os.O_WRONLY, 0644) defer f.Close() if err != nil { logs.Error(err) @@ -159,7 +159,7 @@ func loadConfig() (host, vkey, connType string) { logs.Warn("not found config dir") return } - f, err := os.OpenFile(ph+"npc.conf", os.O_RDONLY, 0644) + f, err := os.OpenFile(path.Join(ph, "npc.conf"), os.O_RDONLY, 0644) defer f.Close() if err != nil { logs.Error(err)