mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-22 12:24:25 +00:00
14 lines
160 B
Go
14 lines
160 B
Go
package homedir
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
func Expand(path string) string {
|
|
if path[0:2] == "~/" {
|
|
return os.Getenv("HOME") + path[1:]
|
|
} else {
|
|
return path
|
|
}
|
|
}
|