chooseExe finds and returns path to preferred binary. names is a list of names to search on both Linux and OSX. osxNames is a list of names specific to OSX. names always has a higher priority than osxNames. The order of the name within each list decides its priority (e.g. the first name has a higher
(names, osxNames []string, paths []string)
| 192 | // It returns a string with path to the binary and a boolean indicating if any |
| 193 | // acceptable binary was found. |
| 194 | func chooseExe(names, osxNames []string, paths []string) (string, bool) { |
| 195 | if runtime.GOOS == "darwin" { |
| 196 | names = append(names, osxNames...) |
| 197 | } |
| 198 | for _, name := range names { |
| 199 | if binary, found := findExe(name, paths); found { |
| 200 | return binary, true |
| 201 | } |
| 202 | } |
| 203 | return "", false |
| 204 | } |
| 205 | |
| 206 | // isLLVMObjdump accepts a string with path to an objdump binary, |
| 207 | // and returns a boolean indicating if the given binary is an LLVM |