From e3846cabf63ceb27e05a2bea5b7f99125b1333b2 Mon Sep 17 00:00:00 2001 From: luhaoling <2198702716@qq.com> Date: Mon, 26 Feb 2024 17:26:32 +0800 Subject: [PATCH] fix: fix the component check of path --- tools/component/component.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/component/component.go b/tools/component/component.go index 63852aa21..53422c23e 100644 --- a/tools/component/component.go +++ b/tools/component/component.go @@ -47,8 +47,8 @@ var ( cfgPath = flag.String("c", defaultCfgPath, "Path to the configuration file") ) -func initCfg(path string) (*config.GlobalConfig, error) { - data, err := os.ReadFile(path) +func initCfg() (*config.GlobalConfig, error) { + data, err := os.ReadFile(*cfgPath) if err != nil { return nil, errs.Wrap(err, "ReadFile unmarshal failed") } @@ -71,7 +71,7 @@ type checkFunc struct { func main() { flag.Parse() - conf, err := initCfg(defaultCfgPath) + conf, err := initCfg() if err != nil { fmt.Printf("Read config failed: %v\n", err) return