// recursiveFindFiles find files with pattern in the root with depth.
recursiveFindFiles find files with pattern in the root with depth.
// recursiveFindFiles find files with pattern in the root with depth .
func recursiveFindFiles(root string, pattern string) ([]string, error) {
	files := make([]string, 0)
	findfile := func(path string, f os.FileInfo, err error) (inner error) {
		if err != nil {
			return
		}
		if f.IsDir() {
			return
		} else if match, innerr := filepath.Match(pattern, f.Name()); innerr == nil && match {
			files = append(files, path)
		}
		return
	}
	err := filepath.Walk(root, findfile)
	if len(files) == 0 {
		return files, err
	} else {
		return files, err
	}
}
func recursiveFindFiles ( root string , pattern string ) ( [ ] string , error ) { files := make ( [ ] string , 0 ) findfile := func ( path string , f os . FileInfo , err error ) ( inner error ) { if err != nil { return } if f . IsDir ( ) { return } else if match , innerr := filepath . Match ( pattern , f . Name ( ) ) ; innerr == nil && match { files = append ( files , path ) } return } err := filepath . Walk ( root , findfile ) if len ( files ) == 0 { return files , err } else { return files , err } }
recursiveFindFiles find files with pattern in the root with depth.
recursiveFindFiles find files with pattern in the root with depth .