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