Merge pull request #264 from picatz/fix-263

fix undefined: usr bug in core
This commit is contained in:
Simone Margaritelli 2018-05-03 12:06:22 +02:00 committed by GitHub
commit 9196be7a8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -89,7 +89,8 @@ func ExpandPath(path string) (string, error) {
// Check if path is empty
if path != "" {
if strings.HasPrefix(path, "~") {
if usr, err := user.Current(); err != nil {
usr, err := user.Current()
if err != nil {
return "", err
}
// Replace only the first occurrence of ~