Skip to content
This repository was archived by the owner on Jun 12, 2018. It is now read-only.
facebookarchivePublic archive

About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

symwalk

    import "github.com/facebookgo/symwalk"

Package symwalk provides an implementation of symbolic link aware filepath walk.

Walk calls filepath.Walk by providing it with a special WalkFn that wraps the given WalkFn. This function calls the given WalkFn for regular files. However, when it encounters a symbolic link, it resolves the link fully using filepath.EvalSymlinks and recursively calls symwalk.Walk on the resolved path. This ensures that unlike filepath.Walk, traversal does not stop at symbolic links.

Using it can be as simple as:

    Walk(
      "/home/me/src",
      func(path string, info os.FileInfo, err error) error {
        fmt.Println(path)
        return nil
      },
    )

CAVEAT: Note that symwalk.Walk does not terminate if there are any non-terminating loops in the file structure.

About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

⌂ 换网址