gorebuild
gorebuild copied to clipboard
gorebuild will fail on Windows or other OSes where os.PathSeparator is not '/'.
I don't see a mention in the README that gorebuild is not supposed to be supported on Windows, yet it has an issue that would prevent it from working there.
Many places in the code assume that os.PathSeparator is /, but that isn't true on Windows and potentially other OSes.
ioutil.ReadDir(build.Default.GOPATH + "/bin")
build.Default.GOPATH+"/bin/"+f.Name()
return strings.TrimPrefix(dir, build.Default.GOPATH+"/src/")
The correct fix for this is to use filepath package to manipulate system filepaths, rather than concatenating strings. E.g.:
ioutil.ReadDir(filepath.Join(build.Default.GOPATH, "bin"))
filepath.Join(build.Default.GOPATH, "bin", f.Name())
This is true, although the more fundamental issue for Windows users is presumably that the code in dwarf.go currently inspects ELF and Mach-O executables only.