Documentation
¶
Overview ¶
Package dirs provides various utility functions in dealing with directories such as a list of all the files with a given (set of) extensions and finding paths within the Go source directory (GOPATH, etc)
Index ¶
- func AllFiles(path string) ([]string, error)
- func Dirs(path string) []string
- func ExtFileNames(path string, exts []string) []string
- func ExtFiles(path string, exts []string) []os.FileInfo
- func GoSrcDir(dir string) (absDir string, err error)
- func HasFile(path, file string) bool
- func LatestMod(path string, exts []string) time.Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllFiles ¶ added in v0.9.11
AllFiles returns a slice of all the files, recursively, within a given directory
func ExtFileNames ¶
ExtFileNames returns all the file names with given extension(s) in directory in sorted order (if exts is empty then all files are returned)
func ExtFiles ¶
ExtFiles returns all the FileInfo's for files with given extension(s) in directory in sorted order (if exts is empty then all files are returned). In case of error, returns nil.
func GoSrcDir ¶
GoSrcDir tries to locate dir in GOPATH/src/ or GOROOT/src/pkg/ and returns its full path. GOPATH may contain a list of paths. From Robin Elkind github.com/mewkiz/pkg
Types ¶
This section is empty.