You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jimi
f7aa510901
|
9 years ago | |
---|---|---|
README.md | 9 years ago | |
main.go | 9 years ago |
README.md
exedir
Examples of methods for determining the directory path where our executable resides.
-
The
github.com/kardianos/osext
package is used for reference. The other methods will require that the executable is located within the OS search path. -
The first alternative utilizes
exec.LookPath
to find the executable within the OS search path. This method depends on theos
,os/exec
, andpath
packages. -
The next method defines a local function to look for the file named in
args[0]
in the directories listed in thePATH
environment variable. This method depends on theos
andstrings
packages.