PHP
·
发表于 5年以前
·
阅读量:8280
package utils
import (
"io/ioutil"
"os"
"path/filepath"
"strings"
)
//GetAllFileIncludeSubFolder 递归获取某个目录下的所有文件
func GetAllFileIncludeSubFolder(folder string) ([]string, error) {
searchPath := folder
if strings.HasSuffix(folder, "/") {
searchPath = searchPath + "*"
} else {
searchPath = searchPath + "/*"
}
return filepath.Glob(searchPath)
}