From bc0e9eb74e583430f083911b75da9e38c8cef2b2 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 1 Aug 2022 16:09:03 +0800 Subject: [PATCH] config file update --- pkg/common/config/config.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 6c0e1a499..e773fc79b 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -511,13 +511,13 @@ type PDefaultTips struct { func init() { cfgName := os.Getenv("CONFIG_NAME") - fmt.Println(Root, cfgName) + fmt.Println("GET IM CONFIG PATH :", Root, cfgName) - if len(cfgName) == 0 { - cfgName = Root + "/config/config.yaml" + if len(cfgName) != 0 { + Root = cfgName } - bytes, err := ioutil.ReadFile(cfgName) + bytes, err := ioutil.ReadFile(filepath.Join(Root, "config", "config.yaml")) if err != nil { panic(err.Error()) }