Categorygithub.com/northbright/pathhelper
repositorypackage
0.0.0-20220624061013-a987b8a0d722
Repository: https://github.com/northbright/pathhelper.git
Documentation: pkg.go.dev

# README

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