Files
tinygo/src/os/executable_darwin.go
T
2025-05-01 10:53:49 +02:00

20 lines
341 B
Go

//go:build darwin
package os
// via runtime because we need argc/argv ptrs
func runtime_executable_path() string
func Executable() (string, error) {
p := runtime_executable_path()
if p != "" && p[0] == '/' {
// absolute path
return p, nil
}
cwd, err := Getwd()
if err != nil {
return "", err
}
return joinPath(cwd, p), nil
}