avoid unnecessary user home checking

This commit is contained in:
Chris Lu 2021-02-22 16:50:56 -08:00
parent 2270737344
commit 72b0d9d8c4

View file

@ -69,6 +69,10 @@ func CheckFile(filename string) (exists, canRead, canWrite bool, modTime time.Ti
func ResolvePath(path string) string {
if !strings.Contains(path, "~") {
return path
}
usr, _ := user.Current()
dir := usr.HomeDir