From ee45d8e1453eaa9f9e8573ac4f651cb621545655 Mon Sep 17 00:00:00 2001 From: Iwasaki Yudai Date: Mon, 24 Aug 2015 04:48:49 +0900 Subject: [PATCH] Replace `user.Current()` with `os.Getenv("HOME")` `os/user.Current()` is not available on Darwin when a binary is cross compiled from another platform. See also: https://github.com/golang/go/issues/6376 --- app/app.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/app.go b/app/app.go index 98687ae..89a5cd2 100644 --- a/app/app.go +++ b/app/app.go @@ -12,7 +12,6 @@ import ( "net/http" "os" "os/exec" - "os/user" "strconv" "strings" "text/template" @@ -53,11 +52,7 @@ func New(options Options) (*App, error) { prefString := []byte{} prefPath := options.ProfileFile if options.ProfileFile == DefaultProfileFilePath { - usr, err := user.Current() - if err != nil { - return nil, err - } - prefPath = usr.HomeDir + "/.gotty" + prefPath = os.Getenv("HOME") + "/.gotty" } if _, err = os.Stat(prefPath); os.IsNotExist(err) { if options.ProfileFile != DefaultProfileFilePath {