Update: this repo is no longer maintained. Use pathelper instead.
pathhelper is a Golang package which provides path related helper functions.
dir, err := pathhelper.GetCurrentExecDir()
if err != nil {
return
}
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)
}