get the executable path via syscalls or infer it from argv
()
| 51 | |
| 52 | // get the executable path via syscalls or infer it from argv |
| 53 | func executablePath() string { |
| 54 | programPath, err := os.Executable() |
| 55 | if err != nil { |
| 56 | return os.Args[0] |
| 57 | } |
| 58 | return programPath |
| 59 | } |
| 60 | |
| 61 | // check if default config file paths exist |
| 62 | func configFilePath() (string, bool) { |