commit | 9b883c5eb462dd5cb1b0a7a104fe86bc6b9bd391 | [log] [tgz] |
---|---|---|
author | Daniel Theophanes <kardianos@gmail.com> | Tue Feb 07 19:16:55 2017 |
committer | Daniel Theophanes <kardianos@gmail.com> | Tue Feb 07 19:16:55 2017 |
tree | 8326548e5d71be76abfbd5fef7f0911660481f15 | |
parent | c2c54e542fb797ad986b31721e1baedf214ca413 [diff] |
osext: use os.Executable when possible
As of go1.8 the Executable function may be found in os
. The Executable function in the std lib os
package is used if available.
There is sometimes utility in finding the current executable file that is running. This can be used for upgrading the current executable or finding resources located relative to the executable file. Both working directory and the os.Args[0] value are arbitrary and cannot be relied on; os.Args[0] can be “faked”.
Multi-platform and supports: