/pathhelper

pathhelper is a Golang package which provides path related helper functions.

Primary LanguageGoMIT LicenseMIT

pathhelper

Build Status Go Report Card GoDoc

Update: this repo is no longer maintained. Use pathelper instead.

pathhelper is a Golang package which provides path related helper functions.

Get absolute path of current executalbe directory.

dir, err := pathhelper.GetCurrentExecDir()
if err != nil {
    return
}

Get absolute path of given relative path.

It joins absolute path of current executable directory and given relative path into a single absolute path.

p := "./config"
absPath := ""
if absPath, err = pathhelper.GetAbsPath(p); err != nil {
    fmt.Fprintf(os.Stderr, "GetAbsPath(%v) error: %v\n", p, err)
}

Documentation

License