diff options
Diffstat (limited to 'libgo/go/os/executable_darwin.go')
-rw-r--r-- | libgo/go/os/executable_darwin.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libgo/go/os/executable_darwin.go b/libgo/go/os/executable_darwin.go index ce5b814..dae9f4e 100644 --- a/libgo/go/os/executable_darwin.go +++ b/libgo/go/os/executable_darwin.go @@ -4,12 +4,17 @@ package os +import "errors" + var executablePath string // set by ../runtime/os_darwin.go var initCwd, initCwdErr = Getwd() func executable() (string, error) { ep := executablePath + if len(ep) == 0 { + return ep, errors.New("cannot find executable path") + } if ep[0] != '/' { if initCwdErr != nil { return ep, initCwdErr |