pathfinder: bitbucket.org/abex/pathfinder Index | Examples | Files

package pathfinder

import "bitbucket.org/abex/pathfinder"

package pathfinder provides a simple api for finding a directory located with your source folder

Index

Examples

Package Files

pathfinder.go

func FindDir Uses

func FindDir(pkgname, dirname string) (ret string, err error)

FindDir looks for Directory 'dirname' in the working directory, then in pkgname's source directory. It works with multiple GOPATHs

Code:

path, err := pathfinder.FindDir("bitbucket.org/abex/pathfinder", ".")
if err != nil {
    panic(err)
}
if _, err := os.Stat(filepath.Join(path, "pathfinder.go")); err == nil {
    fmt.Println("ok!")
}

Output:

ok!

type CannotFindError Uses

type CannotFindError struct {
    // contains filtered or unexported fields
}

CannotFindError is returned when FindDir fails to find the named directory

func (CannotFindError) Error Uses

func (c CannotFindError) Error() string

func (CannotFindError) String Uses

func (c CannotFindError) String() string

Package pathfinder imports 3 packages (graph). Updated 2019-04-23. Refresh now. Tools for package owners.