mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-11-22 08:25:38 +00:00
commit
e359fa7d2d
2 changed files with 10 additions and 3 deletions
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
*~
|
||||
.cli.test
|
||||
.lint
|
||||
.test
|
||||
.vet
|
||||
gomtree
|
7
walk.go
7
walk.go
|
@ -25,9 +25,10 @@ var ExcludeNonDirectories = func(path string, info os.FileInfo) bool {
|
|||
|
||||
var defaultSetKeywords = []KeyVal{"type=file", "nlink=1", "flags=none", "mode=0664"}
|
||||
|
||||
// Walk from root directory and assemble the DirectoryHierarchy. excludes
|
||||
// provided are used to skip paths. keywords are the set to collect from the
|
||||
// walked paths. The recommended default list is DefaultKeywords.
|
||||
// Walk from root directory and assemble the DirectoryHierarchy
|
||||
// * `excludes` provided are used to skip paths
|
||||
// * `keywords` are the set to collect from the walked paths. The recommended default list is DefaultKeywords.
|
||||
// * `fsEval` is the interface to use in evaluating files. If `nil`, then DefaultFsEval is used.
|
||||
func Walk(root string, excludes []ExcludeFunc, keywords []Keyword, fsEval FsEval) (*DirectoryHierarchy, error) {
|
||||
if fsEval == nil {
|
||||
fsEval = DefaultFsEval{}
|
||||
|
|
Loading…
Reference in a new issue