From 8ee691e938974cc83d89c47e5db742d4624267d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Sat, 11 Jun 2022 19:18:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index d311f06..06e2089 100644 --- a/client.go +++ b/client.go @@ -90,6 +90,12 @@ func (c *client) AddWithConfigFile(cfgFilePath string) error { // // Date : 19:19 2022/6/5 func (c *client) BatchAddWithConfigDir(cfgDir string) error { + filepathNames, _ := filepath.Glob(filepath.Join(cfgDir, "*")) + for i := range filepathNames { + if err := c.AddWithConfigFile(filepathNames[i]); nil != err { + return err + } + } return nil } @@ -98,8 +104,9 @@ func (c *client) BatchAddWithConfigDir(cfgDir string) error { // Author : go_developer@163.com<白茶清欢> // // Date : 14:39 2022/6/9 -func (c *client) getMysqlCfgFileList(cfgDir string) ([]*cfgFile, error) { +func (c *client) getMysqlCfgFileList(cfgDir string) ([]string, error) { filepathNames, _ := filepath.Glob(filepath.Join(cfgDir, "*")) + cfgFileList := make([]*cfgFile, 0) for i := range filepathNames { var (