dirs

package
v0.9.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2019 License: BSD-3-Clause Imports: 8 Imported by: 16

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dirs

func Dirs(path string) []string

Dirs returns a slice of all the directories within a given directory

func ExtFileNames

func ExtFileNames(path string, exts []string) []string

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

func ExtFiles(path string, exts []string) []os.FileInfo

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

func GoSrcDir(dir string) (absDir string, err error)

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

func LatestMod

func LatestMod(path string, exts []string) time.Time

LatestMod returns the latest (most recent) modification time for any of the files in the directory (optinally filtered by extension(s) if exts != nil) if no files or error, returns zero time value

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL