|
|
@@ -9,7 +9,7 @@ import (
|
|
|
)
|
|
|
|
|
|
// GetAllFilePath 获取指定目录内的文件和子目录的文件,递归获取
|
|
|
-func GetAllFilePath(filePaths []string, currentPath string) (excelPaths []string, err error) {
|
|
|
+func GetAllFilePath(filePaths []string, currentPath string) ([]string, error) {
|
|
|
//2021-12-23
|
|
|
files, err := ioutil.ReadDir(currentPath)
|
|
|
|
|
|
@@ -19,7 +19,8 @@ func GetAllFilePath(filePaths []string, currentPath string) (excelPaths []string
|
|
|
}
|
|
|
for _, f := range files {
|
|
|
if f.IsDir() {
|
|
|
- return GetAllFilePath(filePaths, filepath.Join(currentPath, f.Name()))
|
|
|
+ ret, _ := GetAllFilePath(filePaths, filepath.Join(currentPath, f.Name()))
|
|
|
+ filePaths = append(filePaths, ret...)
|
|
|
} else {
|
|
|
filePaths = append(filePaths, filepath.Join(currentPath, f.Name()))
|
|
|
}
|