gotty/pkg/homedir/expand.go

14 lines
160 B
Go
Raw Permalink Normal View History

2017-02-25 22:37:07 +00:00
package homedir
import (
"os"
)
2017-02-25 22:37:07 +00:00
func Expand(path string) string {
if path[0:2] == "~/" {
return os.Getenv("HOME") + path[1:]
} else {
return path
}
}