gotty/pkg/homedir/expand.go
Iwasaki Yudai a6133f34b7 Refactor
2017-08-11 15:31:11 +09:00

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
}
}