fix undefined: usr bug in core

The following fixes the issue for me when I run the following test:

$ go test -v -run=TestCoreExpandPath ./core
This commit is contained in:
Kent Gruber 2018-05-03 01:54:23 -04:00
parent eaa5dab166
commit f623505816

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 ~