if block ends with a return statement drop this else and outdent its block

This commit is contained in:
Kent Gruber 2018-05-01 23:05:26 -04:00
commit 8193834f0f

View file

@ -92,10 +92,9 @@ func ExpandPath(path string) (string, error) {
if strings.HasPrefix(path, "~") {
if usr, err := user.Current(); err != nil {
return "", err
} else {
// Replace only the first occurrence of ~
path = strings.Replace(path, "~", usr.HomeDir, 1)
}
// Replace only the first occurrence of ~
path = strings.Replace(path, "~", usr.HomeDir, 1)
}
return filepath.Abs(path)
}