Skip to content

wiggisser/pathresolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pathresolver

Provides a simple path resolving mechanism relative to a defined basedir

Installation

go get github.com/wiggisser/pathresolver

Examples

package main
import (
    pr "github.com/wiggisser/pathresolver"
)

func main() {
    //initializes the pathresolver to "~/.fooapp/" on unix-based systems and "%HOMEDIR%\AppData\Roaming\fooapp" on windows-based systems
    err := pr.Init(".fooapp", "AppData\\Roaming\\fooapp")

    //resolves to "~/.fooapp" and "%HOMEDIR%\AppData\Roaming\fooapp" on unix and windows respectively
    p, err := pr.Path("")


    //resolves the filename to "~/.fooapp/foo.bar" and "%HOMEDIR%\AppData\Roaming\fooapp\foo.bar" on unix and windows respectively
    p, err := pr.Path("foo.bar")
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages