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 (