From 39293933c5b8cb65ad1b51a2a7f1b0247ac1ab4e Mon Sep 17 00:00:00 2001 From: Iwasaki Yudai Date: Sun, 23 Aug 2015 23:28:56 +0900 Subject: [PATCH] Show error when failed to get current user --- app/app.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index 439a7c8..98687ae 100644 --- a/app/app.go +++ b/app/app.go @@ -53,7 +53,10 @@ func New(options Options) (*App, error) { prefString := []byte{} prefPath := options.ProfileFile if options.ProfileFile == DefaultProfileFilePath { - usr, _ := user.Current() + usr, err := user.Current() + if err != nil { + return nil, err + } prefPath = usr.HomeDir + "/.gotty" } if _, err = os.Stat(prefPath); os.IsNotExist(err) {