From af628dde075afb76fa300a6b53fb8beb27d7618a Mon Sep 17 00:00:00 2001 From: David Martorana Date: Thu, 1 Mar 2018 16:18:41 -0500 Subject: [PATCH] Fix "Current not implemented on freebsd/amd64" error (#39) --- stack/stack.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/stack/stack.go b/stack/stack.go index 7f8929b..0aad495 100644 --- a/stack/stack.go +++ b/stack/stack.go @@ -884,11 +884,17 @@ func getGOPATHs() []string { } } if len(out) == 0 { + homeDir := "" u, err := user.Current() if err != nil { - panic(err) + homeDir = os.Getenv("HOME") + if homeDir == "" { + panic(fmt.Sprintf("Could not get current user or $HOME: %s\n", err.Error())) + } + } else { + homeDir = u.HomeDir } - out = []string{u.HomeDir + "go"} + out = []string{homeDir + "go"} } return out }