From f623505816b70e898b7e4057ff5cb04b8dcccd1a Mon Sep 17 00:00:00 2001 From: Kent Gruber Date: Thu, 3 May 2018 01:54:23 -0400 Subject: [PATCH] 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 --- core/core.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/core.go b/core/core.go index 072ae821..ffbcf8e2 100644 --- a/core/core.go +++ b/core/core.go @@ -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 ~